Getting NVIDIA GPU to work with ubuntu 24.04

I upgraded to ubuntu 24.04 and kernel 9.3 due to hardware compatibility with my new Laptop.
Unfortunately, I cant seem to get the NVIDIA GPU to work properly.

I cannot install the driver using ubuntu drivers. But I can install the drivers using apt.
as of right now, im on version 535, but newer version seemed to have the same behavior.

Behaviour:
The GPU is successfully recognized, and software such as Davinci resolve successfully recognizes the GPU.
Smi also detects the software, but it seems that most actions I do, including gpu benchmarks, starting games etc are severely underperforming (Eg. 10 FPS in nearly any game no matter if through proton or linux native, benchmark results <5% of what they should be).

In the meantime, the GPU power target is at 5 watts, and ~50°c. nvidia smi shows that the corresponding software is using the gpu, in the below example age of empires 2. I do see frame improvements (from 8 to 12) Frames, when changing the performance target in nvidia settings, and I see frame rate improvements when reducing the resolution. Other graphics settings do not seem to affect the behavior

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.171.04             Driver Version: 535.171.04   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 4060 ...    Off | 00000000:01:00.0 Off |                  N/A |
| N/A   49C    P8               5W /  60W |   3471MiB /  8188MiB |     30%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      3709      G   /usr/lib/xorg/Xorg                          220MiB |
|    0   N/A  N/A      4036      G   ...libexec/gnome-remote-desktop-daemon        2MiB |
|    0   N/A  N/A     10866    C+G   ...teamapps\common\AoE2DE\AoE2DE_s.exe     3220MiB |
+---------------------------------------------------------------------------------------+

Davinci resolve seems to utilize the GPU properly, but quickly brings “GPU Memory Full” errors, when the GPU Memory is not full

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.171.04             Driver Version: 535.171.04   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 4060 ...    Off | 00000000:01:00.0 Off |                  N/A |
| N/A   62C    P0              43W /  60W |    795MiB /  8188MiB |     40%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      3896      G   /usr/lib/xorg/Xorg                            4MiB |
|    0   N/A  N/A      4213      G   ...libexec/gnome-remote-desktop-daemon        2MiB |
|    0   N/A  N/A     10694      C   /opt/resolve/bin/resolve                    778MiB |
+---------------------------------------------------------------------------------------+

when checking for prime, it tells me, the nvidia gpu is selected:

prime-select query
> nvidia

but when checking glxinfo, it tells me it uses the fallback cpu renderer:

glxinfo | grep "OpenGL renderer"
OpenGL renderer string: llvmpipe (LLVM 17.0.6, 256 bits)

this is my debug log:
nvidia-bug-report.log.gz (450.6 KB)

any help or hints in the right direction are much appreciated, as I am fighting with that laptop for quite some time now.

Best regards,

Julian

1 Like

I have exactly the same issue with:

Asus ZenBook-UX533FD 6.8.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Mon May 20 15:51:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

NVIDIA GeForce GTX 1050 with Max-Q Design

nvidia-driver-535

The hwinfo --gfxcard command lists the card as Device Name: "Second VGA" Model: "nVidia GP107M [GeForce GTX 1050 Mobile]" and the default is the Intel card. ffmpeg can use the GPU with the --hwaccel nvdec flag but none of the other applications can (or do).

1 Like

Can confirm that ffmpeg works with said flag.

as mentioned earlier, It’s likely a bug with the open gl render interface or so?
FFMPEG/Davinci likely work because they use the cuda library which probably works differently.

Can you also confirm that opening an application which does not work properly successfully allocates gpu memory but does not really occupy the GPU (watts target)

Your primary gpu is the amd igpu but the amdgpu driver is missing so the simpledrm fallback driver is used. You seem to have a driver from mainline ppa installed. Please return to the stock kernel and make sure all linux-modules packages are installed.

Please also check if you have blacklisted the amdgpu driver.

Hello Generix,

the stock kernel is not feasible. Ubuntu 24.04 with kernel 6.8 has major visual glitches.
To be precise, in several circumstances, the monitor glitches out and starts a white strobe effect which affects several areas at first, until it quickly affects the whole screen until reboot.
This is reproducible in the following occasions:

  • switching resolution or refresh rate of the monitor
  • watching a video in full screen
  • playing a game
  • Switching any app to full screen

A visual example of this can be found here, though the effect is even worse. (Its not my thread, but the visual effect looks very simmilar.

I have been able to confirm the hardware is not defective by installing windows temporairly.

The AMD GPU driver is not blacklisted specifically, though I have tried switching to dedicated gpu only in BIOS in the past as well as choosing Prime = nvidia.

Yesterday, I have installed a clean ubuntu 24.04 with stock kernel and re-encountered the aforementioned issues. If that’s helpful, I can execute any tests on this version and pull another nvidia bug report from there

Then please try upgrading the kernel to 6.9 using the liquorix ppa. Afterwards, please create a new nvidia-bug-report.log.

1 Like

Ill be able to report back later that day, latest tomorrow. Im at work right now

im happy to report that the liquorix ppa brought me very far.
I think the GPU issue is now fixed. The gpu performs as expected.

unfortunately, my beloved game AoE2de does not start at all but everything else works. Also the AMD iGPU Driver is not working :/

I will now install it on my main system and see if I encounter any further errors…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.