I have a laptop with both AMD Raven and Nvidia GTX 1050 video adapters. I wanted to test the new game mode in Ubuntu 20.04, and noticed that only the AMD Raven actually works. To do the test, I tried launching a terminal and running gxgears, both in a normal way, and then using the “start using dedicated video adapter” (or whatever it really is in English) option in gnome-shell.
Using the standard video adapter (probably the AMD Raven), it works, but slowly.
Using the dedicated video adapter, I get the following:
juloliv@juloliv:~$ glxgears
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: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 25
Current serial number in output stream: 26
NB: in both cases, I tried launching nvidia-settings and got the following:
juloliv@juloliv:~$ nvidia-settings
ERROR: Unable to load info from any available system
(nvidia-settings:9213): GLib-GObject-CRITICAL **: 12:33:29.270: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed
** Message: 12:33:29.273: PRIME: No offloading required. Abort
** Message: 12:33:29.273: PRIME: is it supported? no
And then a blank window…
NB: I’m using nvidia-driver-440 installed through Ubuntu’s “additional drivers”.
Actually, I’ve just found out that adding “Option “PrimaryGPU” “Yes”” to /usr/share/X11/xorg.conf.d/10-nvidia.conf made the 3D acceleration (and nvidia-settings) work! However, now, I have no way to switch between AMD Raven and GTX: it always uses the GTX.
No, it doesn’t change a thing. Actually, the only way, for me, to switch between AMD and NVIDIA is by enabling / disabling
Option “PrimaryGPU” “Yes” in /usr/share/X11/xorg.conf.d/10-nvidia.conf, and then restarting.
PS: just to be sure, is there a good way to know which adapter is being used? I use nvidia-smi and glxinfo | grep vendor for that, but maybe it’s misleading…
It’s the correct way to check which gpu gets used. When switched to intel mode, the nvidia gpu should normally be powered off and the nvidia drivers are blacklisted. Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post. You will have to rename the file ending to something else since the forum software doesn’t accept .gz files (nifty!).
juloliv@juloliv:~$ cat /var/log/gpu-manager.log
log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
can’t access /opt/amdgpu-pro/bin/amdgpu-pro-px
Looking for nvidia modules in /lib/modules/5.4.0-26-generic/updates/dkms
Found nvidia module: nvidia-modeset.ko
Looking for amdgpu modules in /lib/modules/5.4.0-26-generic/updates/dkms
Is nvidia loaded? yes
Was nvidia unloaded? no
Is nvidia blacklisted? yes
Is intel loaded? no
Is radeon loaded? no
Is radeon blacklisted? no
Is amdgpu loaded? yes
Is amdgpu blacklisted? no
Is amdgpu versioned? no
Is amdgpu pro stack? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is nvidia kernel module available? yes
Is amdgpu kernel module available? no
Vendor/Device Id: 10de:1c92
BusID “PCI:1@0:0:0”
Is boot vga? no
Vendor/Device Id: 1002:15d8
BusID “PCI:5@0:0:0”
Is boot vga? yes
Skipping “/dev/dri/card1”, driven by “nvidia-drm”
Found “/dev/dri/card0”, driven by “amdgpu”
output 0:
card0-eDP-1
Number of connected outputs for /dev/dri/card0: 1
Skipping “/dev/dri/card1”, driven by “nvidia-drm”
Skipping “/dev/dri/card0”, driven by “amdgpu”
Skipping “/dev/dri/card1”, driven by “nvidia-drm”
Skipping “/dev/dri/card0”, driven by “amdgpu”
Skipping “/dev/dri/card1”, driven by “nvidia-drm”
Skipping “/dev/dri/card0”, driven by “amdgpu”
Does it require offloading? no
last cards number = 2
Has amd? yes
Has intel? no
Has nvidia? yes
How many cards? 2
Has the system changed? No
Unsupported discrete card vendor: 10de
Nothing to do
Looks like the gpu-manager was changed again for 20.04 so that they’re also not providing let alone using bbswitch anymore. You could check if disabling nvidia-persistenced (sudo systemctl disable nvidia-persistenced) keeps the modules from loading.
You should stick to the Ubuntu bug report you opened so this whole mess with prime-select, gpu-manager and amd/nvidia combo get fixed.
So, I disabled nvidia-persistenced, and, after a reboot, I was indeed using the AMD driver. Then, I typed “sudo prime-select nvidia”, and, upon the next reboot, I was using the Nvidia driver.
So, this is a great step forward because i can now switch between the AMD and Nvidia driver. But the last thing bothering me now is that I need a reboot after each “prime-select”. Do you know if there is a way to switch drivers without rebooting? Also, what is the “on-demand” prime profile?
PS: sorry for the stupid questions, but I’m just discovering all this…
For driver switching, restarting the Xserver(s) is necessary. Since Gnome is actually running two Xservers (one for user, one for GDM), it’s safer to reboot.
Normally, (now) prime-select has three states:
intel: nvidia gpu off, drivers unloaded, igpu used
nvidia: nvidia gpu on, drivers loaded, set as PrimaryGPU, dgpu used
on-demand: nvidia gpu on, drivers loaded, not set as PrimaryGPU, igpu used
the latter having two use-cases, a) using the nvdia gpu for cuda, or b) have additional config and use render offloading.
For render offload, please see the link I provided at the beginning of this thread.
Those three states doesn’t help you much since prime-select doesn’t work correctly for amd/nvidia so fails to set the PrimaryGPU setting.