Nvidia discrete graphic card not working

Hi to all,
I’ve been using Fedora for several years, and I’ve never been interested so much in discrete graphic cards. Now I got a Lenovo Thinkpad P53s, that comes with an Nvidia Quadro P520 and I’m trying to get it working.
I installed the driver from Rpm-Fusion as described. Also I noticed some problem on Kernel or driver upgrade. I read that is related to system suspension, so I masked the nvidia-powerd.service.
Unfortunately, It seems not to work.
As far as I know, Nvidia driver works on Wayland but in a dedicated session you have to choose from GDM. I don’t have this option available. I can see an option “launch with discrete graphics card” right-clicking on program icons, but nothing seems to happen.
Here the questions:

  1. What is the state of art of nvdia graphic card? I mean could I use the “launch with discrete graphics…” option under Wayland? It would be my preferred behavior since I don’t use dGPU so much.
  2. What have I to do in order to get at least the GDM session active?

Some specs:
Lenovo Thinkpad P53s - Nvdia Quadro P520

$ modinfo -F version nvidia
535.54.03

$ uname -r
6.3.8-200.fc38.x86_64

I hope you can understand my English since it’s not my mother language.
Any advice would be appreciated. Many thank in advance.
Paolo

Any hint on how to get the dGPU working? What should be the expected behavior?
Thanks

A couple things that you can provide for us to assist.
Please post the output of
dnf list installed '*nvidia*'
dnf repolist
lsmod | grep -E 'nouveau|nvidia'
inxi -Fzxx
mokutil --sb-state

With that info we should be able to identify most problems and provide suggestions.

I also suggest (if not recently done) that you do a full upgrade sudo dnf upgrade --refresh

Many thanks for your help @computersavvy. Here the output of the commands you required.

$ dnf list installed '*nvidia*'
Pacchetti installati
akmod-nvidia.x86_64         3:535.54.03-1.fc38  @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64  3:535.54.03-2.fc38  @rpmfusion-nonfree-nvidia-driver

$  dnf repolist
id repo                                        nome repo
copr:copr.fedorainfracloud.org:phracek:PyCharm Copr repo for PyCharm owned by phracek
fedora                                         Fedora 38 - x86_64
fedora-cisco-openh264                          Fedora 38 openh264 (From Cisco) - x86_64
fedora-modular                                 Fedora Modular 38 - x86_64
google-chrome                                  google-chrome
insync                                         insync repo
rpmfusion-free                                 RPM Fusion for Fedora 38 - Free
rpmfusion-free-updates                         RPM Fusion for Fedora 38 - Free - Updates
rpmfusion-nonfree                              RPM Fusion for Fedora 38 - Nonfree
rpmfusion-nonfree-nvidia-driver                RPM Fusion for Fedora 38 - Nonfree - NVIDIA Driver
rpmfusion-nonfree-steam                        RPM Fusion for Fedora 38 - Nonfree - Steam
rpmfusion-nonfree-updates                      RPM Fusion for Fedora 38 - Nonfree - Updates
updates                                        Fedora 38 - x86_64 - Updates
updates-modular                                Fedora Modular 38 - x86_64 - Updates

$  lsmod | grep -E 'nouveau|nvidia'
nvidia_drm             94208  1
nvidia_modeset       1556480  2 nvidia_drm
nvidia_uvm           3485696  0
nvidia              62513152  115 nvidia_uvm,nvidia_modeset
video                  73728  3 thinkpad_acpi,i915,nvidia_modeset

$ inxi -Fzxx
System:
  Kernel: 6.4.4-200.fc38.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.39-9.fc38 Desktop: GNOME v: 44.3 tk: GTK v: 3.24.38 wm: gnome-shell
    dm: GDM Distro: Fedora release 38 (Thirty Eight)
Machine:
  Type: Laptop System: LENOVO product: 20N6001JUK v: ThinkPad P53s
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: LENOVO model: 20N6001JUK v: SDK0J40697 WIN
    serial: <superuser required> UEFI: LENOVO v: N2IETA1W (1.79 )
    date: 01/16/2023
Battery:
  ID-1: BAT0 charge: 8.7 Wh (17.4%) condition: 50.1/57.0 Wh (87.8%)
    volts: 10.8 min: 11.5 model: SMP 02DL012 serial: <filter>
    status: discharging
CPU:
  Info: quad core model: Intel Core i7-8665U bits: 64 type: MT MCP
    arch: Comet/Whiskey Lake note: check rev: C cache: L1: 256 KiB L2: 1024 KiB
    L3: 8 MiB
  Speed (MHz): avg: 800 min/max: 400/4800 cores: 1: 800 2: 800 3: 800 4: 800
    5: 800 6: 800 7: 800 8: 800 bogomips: 33599
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
Graphics:
  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] vendor: Lenovo
    driver: i915 v: kernel arch: Gen-9.5 ports: active: eDP-1 empty: DP-1,
    DP-2, HDMI-A-1, HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:3ea0
  Device-2: NVIDIA GP108GLM [Quadro P520] vendor: Lenovo driver: nvidia
    v: 535.54.03 arch: Pascal pcie: speed: 2.5 GT/s lanes: 4 bus-ID: 3c:00.0
    chip-ID: 10de:1d34
  Device-3: Chicony ThinkPad T490 Webcam driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-8:3 chip-ID: 04f2:b681
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 22.1.9
    compositor: gnome-shell driver: gpu: i915 display-ID: 0
  Monitor-1: eDP-1 model: Lenovo 0x40ba res: 1920x1080 dpi: 142
    diag: 395mm (15.5")
  API: OpenGL v: 4.6 Mesa 23.1.4 renderer: Mesa Intel UHD Graphics 620 (WHL
    GT2) direct-render: Yes
Audio:
  Device-1: Intel Cannon Point-LP High Definition Audio vendor: Lenovo
    driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:9dc8
  API: ALSA v: k6.4.4-200.fc38.x86_64 status: kernel-api
  Server-1: PipeWire v: 0.3.75 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:9df0
  IF: wlp0s20f3 state: up mac: <filter>
  Device-2: Intel Ethernet I219-LM vendor: Lenovo driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15bd
  IF: enp0s31f6 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) driver: btusb
    v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 bus-ID: 1-10:5
    chip-ID: 8087:0aaa
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends
Drives:
  Local Storage: total: 476.94 GiB used: 38.06 GiB (8.0%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: PC SN720
    SDAQNTW-512G-1001 size: 476.94 GiB speed: 31.6 Gb/s lanes: 4
    serial: <filter> temp: 44.9 C
Partition:
  ID-1: / size: 291.97 GiB used: 37.73 GiB (12.9%) fs: btrfs
    dev: /dev/nvme0n1p5
  ID-2: /boot size: 973.4 MiB used: 294 MiB (30.2%) fs: ext4
    dev: /dev/nvme0n1p4
  ID-3: /boot/efi size: 996 MiB used: 46.5 MiB (4.7%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 291.97 GiB used: 37.73 GiB (12.9%) fs: btrfs
    dev: /dev/nvme0n1p5
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 43.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 717 Uptime: 5m Memory: available: 30.96 GiB used: 3.7 GiB (11.9%)
  Init: systemd v: 253 target: graphical (5) default: graphical Compilers:
  gcc: 13.1.1 Packages: pm: rpm pkgs: N/A note: see --rpm pm: flatpak pkgs: 18
  Shell: Bash v: 5.2.15 running-in: gnome-terminal inxi: 3.3.27

$ mokutil --sb-state
SecureBoot enabled

In the previous post I forgot to add that I generated and imported the signature key for using nvidia drivers with secure boot enabled, as explained in rpmfusion’s guide.

The strange thing about that listing is the output of the listing of nvidia packages installed.

One thing clearly missing is the nvidia-gpu-firmware package which is required to support nvidia cards.
Also several of the additional packages that are installed as dependencies for installing akmod-nvidia are missing.
I would have expected that to show something like this.

akmod-nvidia.x86_64                                          3:535.54.03-1.fc38                     @rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.3.12-200.fc38.x86_64.x86_64                    3:535.54.03-1.fc38                     @@commandline                   
kmod-nvidia-6.4.4-200.fc38.x86_64.x86_64                     3:535.54.03-1.fc38                     @@commandline                   
nvidia-gpu-firmware.noarch                                   20230625-151.fc38                      @updates                        
nvidia-persistenced.x86_64                                   3:535.54.03-1.fc38                     @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                                       3:535.54.03-1.fc38                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                                   3:535.54.03-2.fc38                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64                              3:535.54.03-2.fc38                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64                         3:535.54.03-2.fc38                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64                           3:535.54.03-2.fc38                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64                              3:535.54.03-2.fc38                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64                             3:535.54.03-2.fc38                     @rpmfusion-nonfree-nvidia-driver

At this point I would suggest you do a removal of the nvidia packages using
sudo dnf remove '*nvidia*' --noautoremove
followed by a reinstall with
sudo dnf install akmod-nvidia nvidia-gpu-firmware xorg-x11-drv-nvidia-cuda

Wait at least 5 minutes after the install has completed and verify the modules are properly built with dnf list installed kmod-nvidia-$(uname -r) before rebooting. If that does not show the package as installed then wait a bit longer to reboot. That package is built and installed by the akmod-nvidia package after it is installed.

I followed the steps you suggested.
Waited for

$ dnf list installed kmod-nvidia-$(uname -r)
Pacchetti installati
kmod-nvidia-6.4.4-200.fc38.x86_64.x86_64                                                           3:535.54.03-1.fc38                                                            @@commandline

then rebooted. The list command now shows this result:

$  dnf list installed '*nvidia*'
Pacchetti installati
akmod-nvidia.x86_64                                                                       3:535.54.03-1.fc38                                                  @rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.4.4-200.fc38.x86_64.x86_64                                                  3:535.54.03-1.fc38                                                  @@commandline                   
nvidia-gpu-firmware.noarch                                                                20230625-151.fc38                                                   @updates                        
nvidia-persistenced.x86_64                                                                3:535.54.03-1.fc38                                                  @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                                                                    3:535.54.03-1.fc38                                                  @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                                                                3:535.54.03-2.fc38                                                  @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64                                                           3:535.54.03-2.fc38                                                  @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64                                                      3:535.54.03-2.fc38                                                  @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64                                                        3:535.54.03-2.fc38                                                  @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64                                                           3:535.54.03-2.fc38                                                  @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64

but nvidia-smi returns

nvidia-smi 
Thu Jul 27 18:03:05 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.54.03              Driver Version: 535.54.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 P520                    Off | 00000000:3C:00.0 Off |                  N/A |
| N/A   41C    P8              N/A / ERR! |      1MiB /  2048MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      4971      G   /usr/bin/gnome-shell                          0MiB |
+---------------------------------------------------------------------------------------+

I don’t want you to spend too much time on this :slight_smile:

Now what happens if one switches to xorg for the DE instead of wayland? Nvidia-smi is not the only tool to use for verifying the GPU is in use. In fact a dGPU is normally not used by default but must be selected specifically when an app is opened using a right click on the icon for the launcher.

My bad. My previous message was incomplete. I get the nvidia-smi output above also launching some programs (e.g. Gimp) right-clicking and selecting dGPU. Same on Xorg.