3

Originally I wanted to make a live CD with this... However I gave up on that.

So Is there a way to do this, have ubuntu figure out which card is loaded, before loading a driver. Or... How could I create a script to load at boot to "| grep pci... etc" and print for variable to run "activate_AMD.sh" or "activate_NV.sh" etc...

TardisGuy
  • 357
  • 6
  • 24
  • 2
    Seems this is stil valid? https://askubuntu.com/questions/892532/nvidia-card-for-cuda-and-amd-card-for-display-on-ubuntu-16-04 – Rinzwind May 24 '18 at 06:55

1 Answers1

2

Ubuntu automatically detects which GPU is installed in your machine. If you want a script to switch between Nvida and Intel drivers I've found one you can modify here: bauca/graphics-switcher

It will require the program glxinfo which you can get by installing:

sudo apt install mesa-utils

One key function in the bash script that will interest you is this one:

function CheckForCurrentVideoCardInUse {
    local _VIDEO_CARD=`glxinfo|egrep "OpenGL vendor|OpenGL renderer*"`
    if [[ $_VIDEO_CARD == *"NVIDIA"* && $_VIDEO_CARD == *"GeForce"* ]]; then
        CURRENT_VIDEO_CARD="NVIDIA"
    elif [[ $_VIDEO_CARD == *"Intel"* ]]; then
        CURRENT_VIDEO_CARD="INTEL"
    else
        ErrorHandler
    fi
}
WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401