Hello. I encountered the following annoying issue yesterday but failed to solve it after referring to quite a few solutions so I am here for help.
Here is a summary of hardware & software I am using.
Laptop: ROG Flow
CPU: Ryzen 5980H
GPU: Integrated AMD Radeon + Independent Nvidia RTX3050
OS: Ubuntu 18.04.6 (kernel 5.4.234)
Nvidia driver: 525.85.05
Here is a brief description of the problem.
I installed the Nvidia driver using the Official Nvidia.com driver following exactly this link (https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux). After complete and reboot, I found
in the window “Setting - Details - About”, the graphic used is AMD® Renoir rather than Nvidia.
in the window of Nvidia X Server, there are some options missing (like prime profiles).
nvidia-smi always gave me the following information no matter if I was playing a video or running a physical simulation.
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.85.05 Driver Version: 525.85.05 CUDA Version: 12.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:01:00.0 Off | N/A |
| N/A 46C P0 N/A / 35W | 5MiB / 4096MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1833 G /usr/lib/xorg/Xorg 4MiB |
+-----------------------------------------------------------------------------+
So basically I suppose the Nvidia graphic card is not used by Ubuntu 18.04 although the installation of the Nvidia driver seems to be accomplished successfully. Are there any solutions to run that Nvidia graphic card?
BTW, I know the default kernel of Ubuntu 18.04 is outdated but I have to keep this configuration since I plan to run some pre-compiled program which has dependency on Ubuntu 18.04. I tried to update the kernel and later I found 5.4.234 was perhaps the most latest kernel that I am able to use.
I went through the tutorial but I have to say that it is a bit hard for me to fully understand it. What I got is roughly that the PRIME render offload mode is a feature for latest Nvidia graphics and it runs automatically on my Ubuntu.
I followed the tutorial to check and configure environment variables. xrandr --listproviders gave
[ 20.567] (II) Loading sub module "glamoregl"
[ 20.567] (II) LoadModule: "glamoregl"
[ 20.567] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[ 20.570] (II) Module glamoregl: vendor="X.Org Foundation"
[ 20.570] compiled for 1.20.8, module version = 1.0.1
[ 20.570] ABI class: X.Org ANSI C Emulation, version 0.4
[ 20.573] (II) AMDGPU(0): glamor X acceleration enabled on AMD RENOIR (DRM 3.40.0, 5.4.234-0504234-generic, LLVM 11.0.1)
[ 20.573] (II) AMDGPU(0): glamor detected, initialising EGL layer.
So does it mean that the driver installation is fine and the Nvidia graphic card also works properly now? (so I don’t have to fix anything?)
But I don’t quite know what I should expect for when I follow Configure Graphics Applications to Render Using the GPU Screen and Finer-Grained Control of OpenGL in the tutorial.
I run glxgear with and without setting those environment variables but nothing seemed to change. I also put those variables under /etc/profile.d then reboot, but still everything seemed unchanged.
May you please explain a bit more the purpose of setting those environment variables? Does it mean I am able to run a specific application (e.g. a physics simulator) using solely the Nvidia graphics for better performance?
You have a hybrid graphics system, meaning the amd igpu is your primary gpu driving the internal display. When in render offload aka on-demand mode, per default everything will run on the amd gpu. To run selective applications on the nvidia gpu, use the env variables. It should then be visible in the process list of nvidia-smi.
Please don’t put it in /etc/profile.d, remove it from there.
To use the nvidia gpu per default, run
sudo prime-select nvidia
and reboot.
You should check if everything works as it should looking at the process list in nvidia-smi nevertheless since 18.04 didn’t fully support amd/nvidia combos previously and I don’t know whether that has been backported and to what extent.
I ran __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep vendor and here is the output
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
OpenGL vendor string: X.Org
I then ran glxgear in the same bash and checked the output of nvidia-smi. There was no application showing there.
Alternatively, I ran sudo prime-select nvidia and reboot but then I was stuck at the login page (it prompted up again every time after I tried to login).
Finally, I followed this answer to configure the files. But after reboot, nvidia-smi showed No running processes found (even no xorg running).
So just as you said the AMD/Nvidia combo is not fully supported by Ubuntu 18.04. It is ok for me to keep using the Nvidia GPU in render offload mode. But, since seemingly I failed to run selective applications (such as glxgear) on the Nvidia GPU manually, is the render offload mode actually equivalent to the sole-iGPU mode under this circumstance?
I followed the instructions here again this morning and this is the nvidia-bug-report.sh file created in that state: nvidia-bug-report.log.old.gz (342.2 KB)
Something to note:
I didn’t have the file /etc/X11/xorg.conf initially so I cannot “delete” it
I didn’t have the file /usr/share/X11/xorg.conf.d/10-nvidia.conf either so I copied this one from GitHub and modified the key “Option” accordingly.
After those modifications and reboot, I was stuck at the login page (similar to what I experienced yesterday when running sudo prime-select nvidia). But when I tried to run sudo prime-select on-demand the output was the on-demand profile is already set.
Finally I reverted all those modifications and created this nvidia-bug-report.sh file for your reference: nvidia-bug-report.log.gz (315.7 KB)
Ok, I’ve found the cause for all of this. From the general logs, it seems amd/nvidia support was added at some time to 18.04, so it should work.
-but-
you installed the amdgpu-pro driver from amd, that one shouldn’t be used at all and is breaking things completely. Please uninstall it and create a new nvidia-bug-report.log since some manual actions to remove left-overs might be needed.
On second thought, wait a minute.
Since you have a 5th gen ryzen gpu, the normal amdgpu driver shipped with the 5.4 kernel will not work. So you would need a newer kernel which doesn’t exist anymore since e.g. liquorix cancelled support for 18.04.
Hello. Thank you for the reply. I am glad to know the real reason for all of the mess.
If I understand it correctly, the “solution” should be: to update to a newer kernel so that I can download a proper driver for the AMD GPU, which will then make the AMD/Nvidia combo GPUs both work well.
I may take time later to follow the steps for updating to a new kernel as suggested in the link attached above and post the nvidia-bug-report.sh file for further help. Thanks in advance!
The updated amdgpu driver comes with the newer kernel. So no additional install needed.
The stand-alone amdgpu-pro driver is for amd-only systems, any other graphics device will stop working with it installed.