NVIDIA GPU1 AMD GPU2. Cant get both drivers to work together on ubuntu 16.04

  1. Assuming no drivers installed and no GPUs installed in computer
  2. Add AMD GPU to computer, launch Ubuntu
  3. Install amdgpu-pro driver
  4. Install nvidia driver (for example via sudo apt install nvidia-384)
  5. Shutdown computer
  6. Add NVidia card to computer, launch Ubuntu
  7. Switch to console mode via Ctrl+Alt+F1
  8. sudo nvidia-xconfig
  9. sudo nano /etc/X11/xorg.conf
  10. Comment or delete all lines except Monitor, Device and Screen sections (edit under root). Example result:
Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
  1. lspci | egrep -h "VGA|3D controller" - remember identifiers at the beginning of each line:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii XT [Radeon R9 290X] (rev 80)
02:00.0 VGA compatible controller: NVIDIA Corporation GK110 [GeForce GTX TITAN] (rev a1)
  1. sudo nano /etc/X11/xorg.conf and use these identifiers:
Section "Monitor"
    ... no changes ...
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusId          "PCI:2@0:0:0" # Add this line (identifier 2 taken from lspci output on the previous step)
EndSection

# Add similar section for AMD card:
Section "Device"
    Identifier     "Device1"
    Driver         "amdgpu"
    BusId          "PCI:1@0:0:0" # Identifier 1 taken from lspci output
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"     # This identifier should be from the GPU device connected to display (you need NVidia, so it is Device0) 
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
  1. Shutdown
  2. Connect display to NVidia card
  3. Launch Ubuntu - everything should work

If it doesn’t work - please provide output of lspci | egrep -h "VGA|3D controller", your /etc/X11/xorg.conf and /var/log/Xorg.0.log.

P.S. somebody please guide me how to properly "post" this answer for these similar questions:

  • Mixing AMD and Nvidia graphics cards in Ubuntu
  • How do I get both an AMD and NVidia GPU to not crash lightdm or hang on startup?
  • Setting up CUDA on NVIDIA and AMD GPU system, starting lightdm removes nvidia binaries
  • Using both nvidia and amd gpu in the same machine