Unable to run GPU on ubuntu 20.04 without root

So I have been asked to try to speed up some critical code using GPU/CUDA so I pulled out my old laptop to develop & test some CUDA software (In my PC I have and AMD GPU and sadly I currently cannot afford a new GPU for my PC).
The problem is, however, no matter how hard I try to set it all up, it fails to start.

I have been able to reach a stage when I just have to run nvidia-smi or nvidia-settings as a superuser and then it switches to the right GPU and works even without sudo privileges, but I am wondering, how can I fix it so it works right after boot?

I have tried reinstalling drivers, refreshing dkms, reinstalling cuda toolkit, updated kernel to hwe, basically everything that is suggested on the first three pages of google.

To sum it up:
When I write:

nvidia-smi

The result is:

NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

But when I do:

sudo nvidia-smi
nvidia-smi

The output is:

Thu Dec 30 16:36:38 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.86       Driver Version: 470.86       CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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   42C    P0    N/A /  N/A |      0MiB /  2002MiB |      2%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Any way to resolve this?
nvidia-bug-report.log.gz (324.7 KB)

You have bbswitch and probably also bumblebee installed which unloads the driver on boot. Please uninstall it.

1 Like

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