Can't run any program via NVIDIA card

I installed GPU drivers from NVIDIA repository (https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=OpenSUSE&target_version=15&target_type=rpmnetwork) by using “sudo zypper install -y cuda” command.

If I run this “NV_PRIME_RENDER_OFFLOAD=1 GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep vendor” command I get an error:

user@localhost:~> __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOPreformatted textR_LIBRARY_NAME=nvidia glxinfo | grep vendor
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:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  39
  Current serial number in output stream:  40.

But if I run “lsmod | grep nvidia” command I can see that driver is seems to be running. Output:

user@localhost:~> lsmod | grep nvidia
nvidia_drm             65536  0
nvidia_modeset       1232896  1 nvidia_drm
nvidia_uvm           1155072  0
nvidia              34082816  2 nvidia_uvm,nvidia_modeset
drm_kms_helper        274432  2 amdgpu,nvidia_drm
drm                   561152  16 gpu_sched,drm_kms_helper,amdgpu,nvidia_drm,ttm

Also here is the output of the “nvidia-smi” command:

user@localhost:~> nvidia-smi
Mon Feb 22 19:49:01 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03    Driver Version: 460.32.03    CUDA Version: 11.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  GeForce GTX 1650    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   49C    P0    16W /  N/A |      0MiB /  3911MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

nvidia-bug-report.log.gz (1.5 MB)

Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

Attached.

The driver loads too late, please try embedding it into the initrd using the add_drivers+ option in /etc/dracut.conf and recreating the initrd.
https://man7.org/linux/man-pages/man5/dracut.conf.5.html

1 Like

Still don’t work
Now my 60-nvidia-default.conf in /etc/dracut.conf.d looks like this:

#line omit_drivers+=" nvidia nvidia-drm nvidia-modeset nvidia-uvm " is a default one
omit_drivers+=" nvidia nvidia-drm nvidia-modeset nvidia-uvm "
add_drivers+=" nvidia "
add_drivers+=" nvidia_uvm "
add_drivers+=" nvidia_modeset "
add_drivers+=" drm "
add_drivers+=" drm_kms_helper "
add_drivers+=" nvidia_drm "

Did I do something wrong ?

The omit_drivers line has to be commented, it disables the nvidia drivers from being added to the initrd. so the file should look like

#omit_drivers+=" nvidia nvidia-drm nvidia-modeset nvidia-uvm "
add_drivers+=" nvidia nvidia-drm nvidia-modeset nvidia-uvm "

and then run sudo dracut -f

1 Like

It works ! It fixed the problem.
Thank you so much!

Hello,

I have the same problem as OP and I do not have a dracut file. Ubuntu 20.04.
±----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.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 GeForce GTX 960 On | 00000000:01:00.0 On | N/A |
| 0% 56C P8 13W / 160W | 510MiB / 2000MiB | 28% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1631 G /usr/lib/xorg/Xorg 50MiB |
| 0 N/A N/A 5872 G /usr/lib/xorg/Xorg 258MiB |
| 0 N/A N/A 6115 G /usr/bin/gnome-shell 62MiB |
| 0 N/A N/A 11192 G …gAAAAAAAAA --shared-files 53MiB |
| 0 N/A N/A 19001 G …AAAAAAAAA= --shared-files 70MiB |
±----------------------------------------------------------------------------+

xxx@xxxxx:~$ lsmod | grep nvidia
nvidia_uvm 1011712 0
nvidia_drm 57344 9
nvidia_modeset 1228800 15 nvidia_drm
nvidia 34041856 754 nvidia_uvm,nvidia_modeset
drm_kms_helper 217088 1 nvidia_drm
drm 552960 12 drm_kms_helper,nvidia_drm

Error:
xxx@xxxxxx:~$ steam
Running Steam on ubuntu 20.04 64-bit
STEAM_RUNTIME is enabled automatically
Pins up-to-date!
Steam client’s requirements are satisfied
/home/wes/.local/share/Steam/ubuntu12_32/steam -nominidumps -nobreakpad
[2021-02-24 17:01:40] Startup - updater built Feb 12 2021 23:21:33
[2021-02-24 17:01:40] Opted in to client beta ‘publicbeta’ via beta file
You are in the ‘publicbeta’ client beta.
SteamUpdateUI: An X Error occurred
X Error of failed request: GLXBadContext
SteamUpdateUI: An X Error occurred
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 151 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 45
xerror_handler: X failed, continuing
Major opcode of failed request: 151 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 46
xerror_handler: X failed, continuing

The Xserver is running correctly on the nvidia gpu. Steam is 32bit, so you need to have the 32bit compatibility libs installed. How did you install the driver?

wget -O /etc/apt/preferences.d/cuda-repository-pin-600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
$ sudo add-apt-repository “deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /”
$ sudo apt install cuda

I see, only the 64bit was installed. Now to find the 32bit installer.

If no easy way exists to have both 32 and 64 bit installed, I believe I found flatpak has Steam. Going to try that in a VM.

The flatpak gave error. :(

Software & Update:
image

I work on this later today.

Thanks @generix . I followed this and now all is working: https://gist.github.com/kmhofmann/cee7c0053da8cc09d62d74a6a4c1c5e4. I did not install cuDNN.

By installing the full cuda bundle, you installed the compute driver, which doesn’t have the 32bit compatibility libs. You need to install the graphics driver from Ubuntu’s software&Updates.