AMD and NVIDIA GPUs together on Ubuntu 20.04
Solution 1
It was fixed by removing nvidia drivers and reinstalling them.
Solution 2
It's not really the answer, but if it helps.
I have both AMD and Nvidia on a laptop I force Nvidia with instruction from https://forums.developer.nvidia.com/t/i-cant-enable-nvidia-gpu-with-nvidia-prime/69899/4
In this file /usr/share/X11/xorg.conf.d/10-nvidia.conf
I put:
Option "PrimaryGPU" "true"
And reboot
Solution 3
Steps to install Ubuntu 20 with Nvidia + AMD
- Install Ubuntu 20.04.2.0 LTS (Focal Fossa) server
- Once started
apt-get update && time apt-get dist-upgrade
- Reboot and then install AMD drivers
wget --referer https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-45 https://drivers.amd.com/drivers/ linux / amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz tar xJf amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz </code> cd amdgpu-pro-20.45-1188099-ubuntu-20.04 sudo ./amdgpu-pro-install --opencl=legacy,pal --headless --no-dkms
- Restart and install Nvidia drivers
ubuntu-drivers autoinstall # Note: check with nvidia-smi # If it has not been installed correctly then execute: sudo apt install nvidia-driver-455
- Reboot and install
clinfo
runapt install clinfo
clinfo
to check that both cards have been detected
Related videos on Youtube
MTita
Updated on September 18, 2022Comments
-
MTita over 1 year
I recently got AMD Radeon RX 5700 XT card and I already had a GeForce RTX 2070 as my main GPU for sometime now. I was trying to run them together and managed to do that on manjaro after installing the AMD card as the main one and running applications on the NVIDA card with prime-run when needed, now I'm trying to move back to Ubuntu and I can't get the same configuration running.
- prime-run doesn't work at all even after installing
nvidia-prime
- Running anything with env vars
__NV_PRIME_RENDER_OFFLOAD=2 __GLX_VENDOR_LIBRARY_NAME=nvidia
doesn't work
root@my-pc:~#__NV_PRIME_RENDER_OFFLOAD=2 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep OpenGL X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 152 (GLX) Minor opcode of failed request: 24 (X_GLXCreateNewContext) Value in failed request: 0x0 Serial number of failed request: 39 Current serial number in output stream: 40
I installed the proprietary drivers for both cards tried the answer here and nothing seem to work.
- prime-run doesn't work at all even after installing
-
RedEyed over 3 yearswhat about xorg.conf, may I put that into device section?
-
0xC0000022L about 3 yearsFor me the
/usr/share/X11/xorg.conf.d/11-nvidia-prime.conf
contains thePrimaryGPU
setting already (search forprime-select
). Also thexorg.conf
in/etc/X11
should take precedence.