Using Nvidia drivers on Fedora 38?

Hi There

I’ve installed the (hopefully) latest nvidia driver for my GPU over rpm fusion.
And tested the installation with “modinfo -F version nvidia” which shows me some 500. number like it’s installed.

Unfortunately i can not use my driver on the machine and it seems not to be “activated”. I’ve really done some research but did not find some solution.

So: What do I need to do to use my driver (and CUDA, installed) on my fedora machine? It seems to be installed already but not usable.

Thanks for your help guys.

so guys. seems that secure boot blocked some things. i diabled secure boot and the command “nvidia-smi” shows somehow the actual version etc. also my nvidia xserver gui shows my quadro GPU now. (but used 0%…).

I’m not sure if it’s setup all correct now. but it seems to work.
Now I need to use CUDA to do some deep learning. but using cuda.is_available. in python shows me onyl my cpu.

so my question now is: is it installed and enabled correctly? and what do i need to do to use CUDA?

thanks.

Have you checked this
https://rpmfusion.org/Howto/NVIDIA

1 Like

do i need to install drivers and cuda seperatlely or is it neccesary to only do once?

i’ve installed both…

so it seems that my driver (and perhaps cuda) is correctly installed. but also: there are no processes on my GPU and no memory used. ? (nvidia-smi)

You needed to also install xorg-x11-drv-nvidia-cuda (sudo dnf install xorg-x11-drv-nvidia-cuda after which any app using cuda would be able to use the gpu. By default when installing akmod-nvidia it installs the cuda-libs but does not install cuda itself.

ok. i did both. installing akmod-nvidia and cuda stuff. but in pytorch i could not use it. (juypter lab). after that i tried the cuda stuff on rpm fusion, but did not change so much

i think the drivers are correctly installed but not really used.

p.s. i did that before. but couldn’t use cuda

Wed Nov 29 20:00:32 2023
±--------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.129.03 Driver Version: 535.129.03 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 Quadro T1000 with Max-Q … Off | 00000000:01:00.0 Off | N/A |
| N/A 46C P8 3W / 35W | 0MiB / 4096MiB | 0% Default |
| | | N/A |
±----------------------------------------±---------------------±---------------------+

±--------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
±--------------------------------------------------------------------------------------+

this could be kind of the point

Please use the preformatted text tags with the </> button on the toolbar to post text that you copy & paste. It retains on screen formatting that way and keeps the text readable.
see below.

$ nvidia-smi
Wed Nov 29 13:06:36 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.129.03             Driver Version: 535.129.03   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:06:00.0  On |                  N/A |
| 30%   56C    P2              85W / 130W |   2442MiB /  8192MiB |     91%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      3474      G   /usr/libexec/Xorg                            99MiB |
|    0   N/A  N/A      3629    C+G   ...libexec/gnome-remote-desktop-daemon       81MiB |
|    0   N/A  N/A      3714      G   /usr/bin/gnome-shell                         76MiB |
|    0   N/A  N/A      4838      G   ...5493674,17065770251073051464,262144       65MiB |
|    0   N/A  N/A      5305      C   ...64-pc-linux-gnu__GW-opencl-nvidia-2     2104MiB |
+---------------------------------------------------------------------------------------+

Please post the output of lsmod | grep nvidia and dnf list installed \*nvidia\*

It also may be necessary to use the right-click menu from the icon and select ‘use discrete gpu’ when launching the app of concern so it properly uses the nvidia GPU.

lsmod | grep nvidia
nvidia_drm             94208  0
nvidia_modeset       1556480  1 nvidia_drm
nvidia_uvm           3510272  0
nvidia              62758912  26 nvidia_uvm,nvidia_modeset
video                  77824  2 i915,nvidia_modeset

dnf list installed \*nvidia\*
Installierte Pakete
akmod-nvidia.x86_64                                                                         3:535.129.03-1.fc38                                                   @rpmfusion-nonfree-updates
kmod-nvidia-6.5.10-200.fc38.x86_64.x86_64                                                   3:535.129.03-1.fc38                                                   @@commandline             
nvidia-persistenced.x86_64                                                                  3:535.129.03-1.fc38                                                   @rpmfusion-nonfree-updates
nvidia-settings.x86_64                                                                      3:535.129.03-1.fc38                                                   @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia.x86_64                                                                  3:535.129.03-2.fc38                                                   @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-cuda.x86_64                                                             3:535.129.03-2.fc38                                                   @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-cuda-libs.i686                                                          3:535.129.03-2.fc38                                                   @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-cuda-libs.x86_64                                                        3:535.129.03-2.fc38                                                   @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-kmodsrc.x86_64                                                          3:535.129.03-2.fc38                                                   @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-libs.i686                                                               3:535.129.03-2.fc38                                                   @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-libs.x86_64                                                             3:535.129.03-2.fc38                                                   @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-power.x86_64                                                            3:535.129.03-2.fc38                                                   @rpmfusion-nonfree-updates

this is the stuff you asked.

right-click on icon?

When you left click on the icon for your app it immediately launches.

If you right click on the same icon it should give you a menu instead of an immediate launch. There you select to use the dedicated graphics card which for your laptop would be the nvidia GPU…

ok. i start my apps over the center or cli. don’t even know where these icons are.
anyway: i want to use my dedicated GPU all the time. I’ve no use for the internal graphics.

so i just wonder why the driver is installad but not used (nor the GPU).

another question ist: how could i test this over cli? i start my jupyter lab over cli because i use a custom conda env. so if i could start this process with GPU support i could test it.

I don’t understand your comment of “don’t even know where these icons are?”
How do you launch apps on your system. Most users with a desktop gui use the icons regularly to launch the apps they use. The icons I spoke of are those same icons.
The icons used to lauch installed apps are available with the ‘Super’ AKA ‘Windows’ key or with ‘Super+A’ while in the gui desktop.

This can be done by first following the instructions at [Fedora Docs] (How to Set Nvidia as Primary GPU on Optimus-based Laptops :: Fedora Docs) to set the machine to always use the nvidia gpu as primary. Then reboot and during login select the ‘gnome on xorg’ option with the gear at the lower right of the screen where you enter the password.

Since you already have the nvidia drivers loaded and functioning you can skip to step 8 and start from that point.

The nvidia GPU is not used by default since it is a laptop and the iGPU uses less power so the dGPU is left idle until the user decides it should be used.

Since most users wish the gui desktop environment very few even use a cli environment.

Do you boot with the desktop then use a terminal or do you immediately log into a cli environment with ctrl+alt+F3 or similar? It does make a difference in what is available.

If you only use the cli environment the nvidia can still be made primary, then log into the gui desktop.
Once there the ctrl+alt+F3 will still get you to the cli login but this time the nvidia gpu would be primary and used for all display on the screen.

1 Like

thanks.
so first: icons: No i use the cli on gui mostly. what i meant: I use desktop icons (or in dolphin) only for app images. otherwise i press “super”, write the first few signs of the programm name and press enter. or i open applications over cli directly. but “Not by pressing with my mouse”. it was just that what i meant.

second:
thanks very much for the link. i did all above step 8 and reboot the system (two times). seems to be configured, but does not function as it should, i think.

here the outputs:

screenfetch
           /:-------------:\          mercus@fedora
        :-------------------::        OS: Fedora 
      :-----------/shhOHbmp---:\      Kernel: x86_64 Linux 6.5.10-200.fc38.x86_64
    /-----------omMMMNNNMMD  ---:     Uptime: 6m
   :-----------sMMMMNMNMP.    ---:    Packages: 7728
  :-----------:MMMdP-------    ---\   Shell: bash 5.2.15
 ,------------:MMMd--------    ---:   Resolution: 3840x2160
 :------------:MMMd-------    .---:   DE: KDE 5.111.0 / Plasma 5.27.9
 :----    oNMMMMMMMMMNho     .----:   WM: KWin
 :--     .+shhhMMMmhhy++   .------/   GTK Theme: Breeze [GTK3]
 :-    -------:MMMd--------------:    Disk: 1.5T / 1.9T (80%)
 :-   --------/MMMd-------------;     CPU: Intel Core i7-10750H @ 12x 5GHz [64.0°C]
 :-    ------/hMMMy------------:      GPU: Quadro T1000 with Max-Q Design
 :-- :dMNdhhdNMMNo------------;       RAM: 6750MiB / 15751MiB
 :---:sdNMMMMNds:------------:       
 :------:://:-------------::         
 :---------------------://           
                              

seems to be nvidia gpu. but:

glxinfo | egrep "OpenGL vendor|OpenGL renderer"
egrep: warning: egrep is obsolescent; using grep -E
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics (CML GT2)

in the gui settings page there is the intel too.

this is my config file:

#This file is provided by xorg-x11-drv-nvidia
#Do not edit

Section "OutputClass"
        Identifier "nvidia"
        MatchDriver "nvidia-drm"
        Driver "nvidia"
        Option "AllowEmptyInitialConfiguration"
        Option "SLI" "Auto"
        Option "BaseMosaic" "on"
        Option "PrimaryGPU" "yes"
EndSection

Section "ServerLayout"
        Identifier "layout"
        Option "AllowNVIDIAGPUScreens"
EndSection

so i think you’re right and the instructions are correct. but the gpu is not used.

 nvidia-smi
Thu Nov 30 15:54:29 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.129.03             Driver Version: 535.129.03   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  Quadro T1000 with Max-Q ...    Off | 00000000:01:00.0 Off |                  N/A |
| N/A   54C    P8               3W /  35W |      0MiB /  4096MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

could you give me the hint, how i can start the jupyter lab on dedicated GPU over cli once? so i could test it this functions, and perhaps it would be a workaround

since i do not play games and most of my apps are not graphics-intensive, i do not “need” to force the gpu to be used. if i would know how to use it when needed, for example in jupyter with pytorch etc. perhaps this would be sufficient.