RTX 3050 is not utilized despite driver being installed (Ubuntu 20.04)


I have a Lenovo Ideapad Pro 5 with a Ryzen 7 CPU and a Nvidia RTX 3050 (laptop) with Ubuntu 20.04 installed as a dual boot with Windows. BitLocker/hard drive encryption is disabled, and secure boot is also disabled.

I have installed the Nvidia 535 driver via the “Additional Drivers” menu in Software and Updates. I am able to open nvidia-smi in the terminal, and the Nvidia X server software also seems to work ok. However, whenever I run anything that should use my GPU, such as glxgears, my GPU is not utilized. Nvidia-smi has the following output:

| NVIDIA-SMI 535.113.01             Driver Version: 535.113.01   CUDA Version: 12.2     |
| 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 RTX 3050 ...    Off | 00000000:01:00.0 Off |                  N/A |
| N/A   40C    P0              N/A /  60W |     14MiB /  6144MiB |      0%      Default |
|                                         |                      |                  N/A |
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|    0   N/A  N/A       961      G   /usr/lib/xorg/Xorg                            4MiB |
|    0   N/A  N/A      1640      G   /usr/lib/xorg/Xorg                            4MiB |

Where it shows that the GPU is barely used. Furthermore, when I run glxinfo, it says that it is using llvmpipe and not my Nvidia GPU. How can I solve this issue so that I can use my GPU with Ubuntu?

I have attached the bug report if needed.

Thanks in advance.
nvidia-bug-report.log.gz (361.5 KB)

From the bug report log, it looks like your system has an AMD chip as the primary GPU and the NVIDIA one is secondary. You can see the NVIDIA GPU listed as a render offload provider in the bug report log:

xrandr --listproviders:

Providers: number : 1
Provider 0: id: 0x1b6 cap: 0x2, Sink Output crtcs: 4 outputs: 1 associated providers: 0 name:NVIDIA-G0

You should be able to use the NVIDIA GPU for rendering by following the instructions here: Chapter 35. PRIME Render Offload

However, performance isn’t going to be great without proper acceleration on the AMD side. I would recommend making sure the appropriate AMD driver is installed and working before trying to use the NVIDIA GPU.

For the AMD gpu to work, you will need a newer kernel and firmware. Rather upgrade to Ubuntu 22.04, and switch to the HWE kernel (6.2) if necessary.

So if I understand it correctly, I need to get my AMD gpu to work before I can get the NVIDIA gpu to work, and to do that, I need to upgrade to Ubuntu 22.04? And there is not another way? Its because I am using some software that only runs on 20.04, and using my GPU for this software is quite essential.

You can also add the liquorix ppa for 20.04 and install an updated kernel from there. Then download and install an updated firmware package from https://packages.ubuntu.com/jammy/all/linux-firmware/download

Edit: direct link to the firmware package http://security.ubuntu.com/ubuntu/pool/main/l/linux-firmware/linux-firmware_20220329.git681281e4-0ubuntu3.14_all.deb