Scheduled Maintenance: Over the course of a few days we will be addressing issues with the search backend. General search, newposts, yourposts, and other search driven queries may fail during the update. Details and discussion here: viewtopic.php?t=159736

 

 

 

Nvidia driver on Legion 9 with RTX 4090 won't load

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Nvidia driver on Legion 9 with RTX 4090 won't load

#1 Post by adonnini »

Hi,
I have a Lenovo Legion 9 with an Nvidia RTX 4090 running Debian 12.6.

I have not been able to get Nvidia to run on my system. Below you will find the steps I have taken to try and get the Nvidia driver to load. To date nothing I have done has worked.

I would appreciate it if anyone might have some suggestions as to what I might try next to attempt to resolve this problem.

Thanks,

Alex Donnini

1) Secure boot disabled
mokutil --sb
-----------------------------------
SecureBoot disabled

2) Bios set to hybrid graphics. If set to discrete graphics system hangs at start-up

3) Removed, purged and reinstalled ```nvidia-driver``` using ```apt-get``` many times

4) I black listed nouveau

5) I have both ```bumblebee``` and ```mesa``` installed. Whether they are installed or not, makes no difference, the Nvidia driver will not load either way.

6) As you will see from the information reported below, Most of the error messages refer to Nvidia files which should be present in ```/lib/modules/6.1.0-22-amd64``` and in ```/dev/```. I have not found any information on how to make that happen or errors that prevent that from happening.

7) I have searched for information on how others have resolved a problem similar to mine. None of the proposed solutions have worked for me. Here are some links to sources of information I have used:
https://wiki.debian.org/NvidiaGraphicsDrivers (and other Debian related resources e.g. Optimus, Mesa and Bumblebee)
https://askubuntu.com/questions/1413512 ... lib-module
https://www.reddit.com/r/debian/comment ... ce_daemon/
https://askubuntu.com/questions/1408652 ... esnt-exist
https://forums.developer.nvidia.com/t/d ... nel/228222
https://forums.developer.nvidia.com/t/d ... dev/283329
https://www.reddit.com/r/linux4noobs/co ... p_by_step/
viewtopic.php?t=148516

Output of current configuration, status related commands
========================================================================================================

Code: Select all

nvidia-detect
----------------------------------
Detected NVIDIA GPUs:
0000:01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GN21-X11 [10de:2757] (rev a1)

Checking card: 00.0 VGA compatible controller
Your card is supported by the default drivers.
It is recommended to install the
    nvidia-driver
========================================================================================================

Code: Select all

uname -m && cat /etc/*release
-------------------------------
x86_64
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Code: Select all

cat /etc/debian_version
-----------------------
12.6

Code: Select all

apt search nvidia-driver
-------------------------------------
 Sorting... Done
Full Text Search... Done
glx-alternative-nvidia/stable,now 1.2.2 amd64 [installed,automatic]
  allows the selection of NVIDIA as GLX provider

libegl-nvidia0/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  NVIDIA binary EGL library

libgl1-nvidia-glvnd-glx/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  NVIDIA binary OpenGL/GLX library (GLVND variant)

libgles-nvidia1/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  NVIDIA binary OpenGL|ES 1.x library

libgles-nvidia2/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  NVIDIA binary OpenGL|ES 2.x library

libglx-nvidia0/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  NVIDIA binary GLX library

nvidia-alternative/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  allows the selection of NVIDIA as GLX provider

nvidia-detect/stable,now 535.183.01-1~deb12u1 amd64 [installed]
  NVIDIA GPU detection utility

nvidia-driver/stable,now 535.183.01-1~deb12u1 amd64 [installed]
  NVIDIA metapackage

nvidia-driver-bin/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  NVIDIA driver support binaries

nvidia-driver-full/stable 535.183.01-1~deb12u1 amd64
  NVIDIA metapackage (all components)

nvidia-driver-libs/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  NVIDIA metapackage (OpenGL/GLX/EGL/GLES libraries)

nvidia-kernel-dkms/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  NVIDIA binary kernel module DKMS source

nvidia-kernel-source/stable 535.183.01-1~deb12u1 amd64
  NVIDIA binary kernel module source

nvidia-open-kernel-dkms/stable 535.183.01-1~deb12u1 amd64
  NVIDIA open kernel module DKMS source

nvidia-open-kernel-source/stable 535.183.01-1~deb12u1 amd64
  NVIDIA open kernel module source

xserver-xorg-video-nvidia/stable,now 535.183.01-1~deb12u1 amd64 [installed,automatic]
  NVIDIA binary Xorg driver
========================================================================================================

Code: Select all

dkms status
------------
bbswitch/0.8: added
nvidia-current/535.183.01: added
========================================================================================================

Code: Select all

apt-cache policy linux-image-amd64 linux-headers-amd64
----------------------------------------------------------
linux-image-amd64:
  Installed: (none)
  Candidate: 6.1.94-1
  Version table:
     6.7.12-1~bpo12+1 100
        100 https://httpredir.debian.org/debian bookworm-backports/main amd64 Packages
     6.1.94-1 500
        500 http://ftp.us.debian.org/debian bookworm/main amd64 Packages
        500 http://ftp.de.debian.org/debian bookworm/main amd64 Packages
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status
     6.1.90-1 500
        500 http://security.debian.org/debian-security bookworm-security/main amd64 Packages
     6.1.67-1 500
        500 http://deb.debian.org/debian bookworm-updates/main amd64 Packages
linux-headers-amd64:
  Installed: 6.1.94-1
  Candidate: 6.1.94-1
  Version table:
     6.7.12-1~bpo12+1 100
        100 https://httpredir.debian.org/debian bookworm-backports/main amd64 Packages
 *** 6.1.94-1 500
        500 http://ftp.us.debian.org/debian bookworm/main amd64 Packages
        500 http://ftp.de.debian.org/debian bookworm/main amd64 Packages
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status
     6.1.90-1 500
        500 http://security.debian.org/debian-security bookworm-security/main amd64 Packages
     6.1.67-1 500
        500 http://deb.debian.org/debian bookworm-updates/main amd64 Packages
========================================================================================================

Code: Select all

apt list -i linux-image-* linux-headers-*
--------------------------------------------
Listing... Done
linux-headers-6.1.0-18-amd64/stable,stable,stable,now 6.1.76-1 amd64 [installed]
linux-headers-6.1.0-18-common/stable,stable,stable,now 6.1.76-1 all [installed,automatic]
linux-headers-6.1.0-22-amd64/stable,stable,stable,now 6.1.94-1 amd64 [installed]
linux-headers-6.1.0-22-common/stable,stable,stable,now 6.1.94-1 all [installed,automatic]
linux-headers-amd64/stable,stable,stable,now 6.1.94-1 amd64 [installed,automatic]
linux-image-6.1.0-18-amd64/stable,stable,stable,now 6.1.76-1 amd64 [installed,automatic]
linux-image-6.1.0-22-amd64/stable,stable,stable,now 6.1.94-1 amd64 [installed]
========================================================================================================

Code: Select all

vrms
---------------
             Non-free packages installed on actlnxlpt7

amd64-microcode                     Processor microcode firmware for AMD CPUs
atmel-firmware                      Firmware for Atmel at76c50x wireless networking chips.
bluez-firmware                      Firmware for Bluetooth devices
dahdi-firmware-nonfree              DAHDI non-free firmware
firmware-amd-graphics               Binary firmware for AMD/ATI graphics chips
firmware-ast                        Binary firmware for ASpeed Technologies graphics chips
firmware-atheros                    Binary firmware for Qualcomm Atheros wireless cards
firmware-bnx2                       Binary firmware for Broadcom NetXtremeII
firmware-bnx2x                      Binary firmware for Broadcom NetXtreme II 10Gb
firmware-brcm80211                  Binary firmware for Broadcom/Cypress 802.11 wireless c
firmware-cavium                     Binary firmware for Cavium Ethernet adapters
firmware-intel-sound                Binary firmware for Intel sound DSPs
firmware-ipw2x00                    Binary firmware for Intel Pro Wireless 2100, 2200 and
firmware-ivtv                       Binary firmware for iTVC15-family MPEG codecs (ivtv an
firmware-iwlwifi                    Binary firmware for Intel Wireless cards
firmware-libertas                   Binary firmware for Marvell wireless cards
firmware-linux                      Binary firmware for various drivers in the Linux kerne
firmware-linux-nonfree              Binary firmware for various drivers in the Linux kerne
firmware-misc-nonfree               Binary firmware for various drivers in the Linux kerne
firmware-myricom                    Binary firmware for Myri-10G Ethernet adapters
firmware-netronome                  Binary firmware for Netronome network adapters
firmware-netxen                     Binary firmware for QLogic Intelligent Ethernet (3000
firmware-nvidia-gsp                 NVIDIA GSP firmware
firmware-qlogic                     Binary firmware for QLogic HBAs
firmware-realtek                    Binary firmware for Realtek wired/wifi/BT adapters
firmware-realtek-rtl8723cs-bt       Bluetooth firmware for Realtek RTL8723CS
firmware-siano                      Binary firmware for Siano MDTV receivers
firmware-sof-signed                 Intel SOF firmware - signed
firmware-zd1211                     binary firmware for the zd1211rw wireless driver
intel-microcode                     Processor microcode firmware for Intel CPUs
libcuda1                            NVIDIA CUDA Driver Library
libegl-nvidia0                      NVIDIA binary EGL library
libgl1-nvidia-glvnd-glx             NVIDIA binary OpenGL/GLX library (GLVND variant)
libgles-nvidia1                     NVIDIA binary OpenGL|ES 1.x library
libgles-nvidia2                     NVIDIA binary OpenGL|ES 2.x library
libglx-nvidia0                      NVIDIA binary GLX library
libnvcuvid1                         NVIDIA CUDA Video Decoder runtime library
libnvidia-allocator1                NVIDIA allocator runtime library
libnvidia-cfg1                      NVIDIA binary OpenGL/GLX configuration library
libnvidia-eglcore                   NVIDIA binary EGL core libraries
libnvidia-encode1                   NVENC Video Encoding runtime library
libnvidia-glcore                    NVIDIA binary OpenGL/GLX core libraries
libnvidia-glvkspirv                 NVIDIA binary Vulkan Spir-V compiler library
libnvidia-ml1                       NVIDIA Management Library (NVML) runtime library
libnvidia-pkcs11-openssl3           NVIDIA PKCS #11 Library (OpenSSL 3)
libnvidia-ptxjitcompiler1           NVIDIA PTX JIT Compiler library
libnvidia-rtcore                    NVIDIA binary Vulkan ray tracing (rtcore) library
nvidia-alternative                  allows the selection of NVIDIA as GLX provider
nvidia-detect                       NVIDIA GPU detection utility
nvidia-driver                       NVIDIA metapackage
nvidia-driver-bin                   NVIDIA driver support binaries
nvidia-driver-libs                  NVIDIA metapackage (OpenGL/GLX/EGL/GLES libraries)
nvidia-egl-common                   NVIDIA binary EGL driver - common files
nvidia-egl-icd                      NVIDIA EGL installable client driver (ICD)
nvidia-kernel-dkms                  NVIDIA binary kernel module DKMS source
nvidia-kernel-support               NVIDIA binary kernel module support files
nvidia-legacy-check                 check for NVIDIA GPUs requiring a legacy driver
nvidia-smi                          NVIDIA System Management Interface
nvidia-suspend-common               NVIDIA driver - systemd power management scripts
nvidia-vdpau-driver                 Video Decode and Presentation API for Unix - NVIDIA dr
nvidia-vulkan-common                NVIDIA Vulkan driver - common files
nvidia-vulkan-icd                   NVIDIA Vulkan installable client driver (ICD)
xserver-xorg-video-nvidia           NVIDIA binary Xorg driver

             Contrib packages installed on actlnxlpt7

bumblebee-nvidia                    NVIDIA Optimus support using the proprietary NVIDIA dr
glx-alternative-mesa                allows the selection of MESA as GLX provider
glx-alternative-nvidia              allows the selection of NVIDIA as GLX provider
glx-diversions                      prepare for using accelerated GLX implementations from
gpustat                             pretty nvidia device monitor
libnvidia-egl-gbm1                  GBM EGL external platform library for NVIDIA
nvidia-installer-cleanup            cleanup after driver installation with the nvidia-inst
nvidia-kernel-common                NVIDIA binary kernel module support files
nvidia-modprobe                     utility to load NVIDIA kernel modules and create devic
nvidia-persistenced                 daemon to maintain persistent software state in the NV
nvidia-primus-vk-common             thin wrapper for the NVIDIA binary Vulkan ICD (common
nvidia-primus-vk-wrapper            thin wrapper for using the NVIDIA binary Vulkan ICD wi
nvidia-settings                     tool for configuring the NVIDIA graphics driver
nvidia-support                      NVIDIA binary graphics driver support files
nvidia-xconfig                      deprecated X configuration tool for non-free NVIDIA dr
nvtop                               Interactive NVIDIA GPU process monitor
primus-nvidia                       NVIDIA Primus support using the proprietary NVIDIA dri
primus-vk-nvidia                    NVIDIA Optimus support for Vulkan applications
python3-pynvml                      Python3 bindings to the NVIDIA Management Library
update-glx                          utility for switching the GLX implementation

  63 non-free packages, 2.1% of 3032 installed packages.
  20 contrib packages, 0.7% of 3032 installed packages.
========================================================================================================

Code: Select all

journalctl -xeu nvidia-persistenced.service
---------------------------------------------
Jul 07 15:40:34 actlnxlpt7 nvidia-persistenced[1053]: nvidia-persistenced failed to initialize. Check syslog for more details.
Jul 07 15:40:34 actlnxlpt7 systemd[1]: nvidia-persistenced.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ An ExecStart= process belonging to unit nvidia-persistenced.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Jul 07 15:40:34 actlnxlpt7 systemd[1]: nvidia-persistenced.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit nvidia-persistenced.service has entered the 'failed' state with result 'exit-code'.
Jul 07 15:40:34 actlnxlpt7 systemd[1]: Failed to start nvidia-persistenced.service - NVIDIA Persistence Daemon.
░░ Subject: A start job for unit nvidia-persistenced.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit nvidia-persistenced.service has finished with a failure.
░░ 
░░ The job identifier is 139 and the job result is failed.
========================================================================================================

Code: Select all

journalctl -b | grep nvidia
--------------------------------
Jul 07 15:40:34 actlnxlpt7 audit[1007]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=1007 comm="apparmor_parser"
Jul 07 15:40:34 actlnxlpt7 audit[1007]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=1007 comm="apparmor_parser"
Jul 07 15:40:34 actlnxlpt7 kernel: audit: type=1400 audit(1720381234.703:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=1007 comm="apparmor_parser"
Jul 07 15:40:34 actlnxlpt7 kernel: audit: type=1400 audit(1720381234.703:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=1007 comm="apparmor_parser"
Jul 07 15:40:34 actlnxlpt7 systemd[1]: Starting nvidia-persistenced.service - NVIDIA Persistence Daemon...
Jul 07 15:40:34 actlnxlpt7 nvidia-persistenced[1072]: Started (1072)
Jul 07 15:40:34 actlnxlpt7 nvidia-persistenced[1072]: Failed to query NVIDIA devices. Please ensure that the NVIDIA device files (/dev/nvidia*) exist, and that user 116 has read and write permissions for those files.
Jul 07 15:40:34 actlnxlpt7 nvidia-persistenced[1072]: Shutdown (1072)
Jul 07 15:40:34 actlnxlpt7 nvidia-persistenced[1053]: nvidia-persistenced failed to initialize. Check syslog for more details.
Jul 07 15:40:34 actlnxlpt7 systemd[1]: nvidia-persistenced.service: Control process exited, code=exited, status=1/FAILURE
Jul 07 15:40:34 actlnxlpt7 systemd[1]: nvidia-persistenced.service: Failed with result 'exit-code'.
Jul 07 15:40:34 actlnxlpt7 systemd[1]: Failed to start nvidia-persistenced.service - NVIDIA Persistence Daemon.
========================================================================================================

Code: Select all

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

Code: Select all

gpustat --debug
--------------------
Error on querying NVIDIA devices. Use --debug flag for details
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gpustat/cli.py", line 18, in print_gpustat
    gpu_stats = GPUStatCollection.new_query(debug=debug)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gpustat/core.py", line 370, in new_query
    N.nvmlInit()
  File "/usr/lib/python3/dist-packages/pynvml.py", line 1785, in nvmlInit
    nvmlInitWithFlags(0)
  File "/usr/lib/python3/dist-packages/pynvml.py", line 1775, in nvmlInitWithFlags
    _nvmlCheckReturn(ret)
  File "/usr/lib/python3/dist-packages/pynvml.py", line 848, in _nvmlCheckReturn
    raise NVMLError(ret)
pynvml.NVMLError_DriverNotLoaded: Driver Not Loaded
========================================================================================================

Code: Select all

modprobe nvidia
--------------------------
modprobe: FATAL: Module nvidia-current not found in directory /lib/modules/6.1.0-22-amd64
modprobe: ERROR: ../libkmod/libkmod-module.c:1047 command_do() Error running install command 'modprobe -i nvidia-current ' for module nvidia: retcode 1
modprobe: ERROR: could not insert 'nvidia': Invalid argument
========================================================================================================

Code: Select all

modprobe -i nvidia-current
-----------------------
modprobe: FATAL: Module nvidia-current not found in directory /lib/modules/6.1.0-22-amd64
root@actlnxlpt7:/var/log# 


Directory ```/lib/modules/6.1.0-22-amd64``` contains nothing related to nvidia  or (nvidia-current) drivers
========================================================================================================

Code: Select all

apt-get install linux-modules-nvidia-535-6.1.0-22-amd64
-----------------------------------------------------------
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-modules-nvidia-535-6.1.0-22-amd64
E: Couldn't find any package by glob 'linux-modules-nvidia-535-6.1.0-22-amd64'
E: Couldn't find any package by regex 'linux-modules-nvidia-535-6.1.0-22-amd64'
========================================================================================================

User avatar
sunrat
Administrator
Administrator
Posts: 6950
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 122 times
Been thanked: 570 times

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#2 Post by sunrat »

Please use code tags for terminal text. Fixed it for you this time.

Considering your graphics card is the latest, it is possible Debian 12 is to old to support it. You may need a newer kernel (possible) and mesa stack (difficult or impossible).
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
@ttila
Posts: 176
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 20 times

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#3 Post by @ttila »

Could you find any errors in the make.log file? It is stored in

Code: Select all

/var/lib/dkms/nvidia-legacy-390xx/390.157/6.9.7-amd64/x86_64/log
your path will be different. Seems that Nvidia drivers aren't compiled

Install the nvidia open kernel instead of nvidia kernel dkms package.

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#4 Post by adonnini »

@ttila wrote: 2024-07-08 13:56 Could you find any errors in the make.log file? It is stored in

Code: Select all

/var/lib/dkms/nvidia-legacy-390xx/390.157/6.9.7-amd64/x86_64/log
your path will be different. Seems that Nvidia drivers aren't compiled

Install the nvidia open kernel instead of nvidia kernel dkms package.
/var/lib/dkms contains
```/var/lib/dkms/nvidia-current/535.183.01``` which has no log directory. It has an empty ```build``` directory and a ```source``` directory.

Do I need to compile the nvidia driver manually, since the build directly is empty? This is pretty strange (at least to me).

When you suggest I install the nvidia open kernel are you referring to nouveau?

Thanks for your suggestions.

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#5 Post by adonnini »

sunrat wrote: 2024-07-08 12:18 Please use code tags for terminal text. Fixed it for you this time.

Considering your graphics card is the latest, it is possible Debian 12 is to old to support it. You may need a newer kernel (possible) and mesa stack (difficult or impossible).
Thanks for taking care of the formatting of my post.

I did install the mesa stack.

I just checked using ```apt-cache search linux-image``` after running ```apt update``` It looks like ```6.1.0-22-amd64``` the kernel I am running is the latest.

Thanks

User avatar
@ttila
Posts: 176
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 20 times

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#6 Post by @ttila »

adonnini wrote: 2024-07-08 18:26 /var/lib/dkms contains
```/var/lib/dkms/nvidia-current/535.183.01``` which has no log directory. It has an empty ```build``` directory and a ```source``` directory.
enter in the source directory and find a file called make.log.
adonnini wrote: 2024-07-08 18:26 Do I need to compile the nvidia driver manually, since the build directly is empty? This is pretty strange (at least to me).
No, dkms will compile for you. It Anyway tomorrow i'll check on my other PC equipped with a 4060TI for the correct folder.
adonnini wrote: 2024-07-08 18:26 When you suggest I install the nvidia open kernel are you referring to nouveau?
No. I mean the closed driver, remove "nvidia-kernel-dkms" an install "nvidia-open-kernel-dkms". Newer video card require that module, it will be the default in the future

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#7 Post by adonnini »

I double checked (and ran a search in /var/lib/dkms). There is no file make.log

I will remove "nvidia-kernel-dkms" an install "nvidia-open-kernel-dkms".

Thanks for your suggestions and quick response

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#8 Post by adonnini »

In order to remove "nvidia-kernel-dkms" an install "nvidia-open-kernel-dkms" first I had to remove the nvidia driver, then remove "nvidia-kernel-dkms", install "nvidia-open-kernel-dkms", and then reinstall the nvidia driver.

Below you will find the output of each command.

Please note three things:
1) Removal of "nvidia-kernel-dkms" triggered the automatic installation of the ```nvidia-tesla-470-driver```

2) Even though I do have the latest headers installed (please see below), the installation of "nvidia-open-kernel-dkms" stated:
```Module build for kernel 6.1.0-22-amd64 was skipped since the
kernel headers for this kernel do not seem to be installed.
```
3) Re-installation of the nvidia-driver contained a number of warnings like this:
```update-alternatives: warning: forcing reinstallation of alternative /usr/lib/nvidia/bumblebee because link group glx is broken
```
Is this a problem?

Thanks

Code: Select all

apt-get install linux-headers-$(uname -r)

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-headers-6.1.0-22-amd64 is already the newest version (6.1.94-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Code: Select all

apt-get remove nvidia-open-kernel-dkms

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  firmware-nvidia-gsp nvidia-open-kernel-support
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  nvidia-open-kernel-dkms
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 200 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 335154 files and directories currently installed.)
Removing nvidia-open-kernel-dkms (535.183.01-1~deb12u1) ...
Deleting module nvidia-current-open-535.183.01 completely from the DKMS tree.

Code: Select all

apt-get install nvidia-open-kernel-dkms

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  nvidia-open-kernel-dkms
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/30.7 MB of archives.
After this operation, 200 MB of additional disk space will be used.
Selecting previously unselected package nvidia-open-kernel-dkms.
(Reading database ... 334690 files and directories currently installed.)
Preparing to unpack .../nvidia-open-kernel-dkms_535.183.01-1~deb12u1_amd64.deb ...
Unpacking nvidia-open-kernel-dkms (535.183.01-1~deb12u1) ...
Setting up nvidia-open-kernel-dkms (535.183.01-1~deb12u1) ...
Loading new nvidia-current-open-535.183.01 DKMS files...
Building for 6.1.0-22-amd64
Module build for kernel 6.1.0-22-amd64 was skipped since the
kernel headers for this kernel do not seem to be installed.

Code: Select all

apt-get install nvidia-driver

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  nvidia-driver-bin
Suggested packages:
  nvidia-kernel-dkms | nvidia-kernel-source | nvidia-open-kernel-source
The following NEW packages will be installed:
  nvidia-driver nvidia-driver-bin
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/734 kB of archives.
After this operation, 1,847 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package nvidia-driver-bin.
(Reading database ... 335154 files and directories currently installed.)
Preparing to unpack .../nvidia-driver-bin_535.183.01-1~deb12u1_amd64.deb ...
Unpacking nvidia-driver-bin (535.183.01-1~deb12u1) ...
Selecting previously unselected package nvidia-driver.
Preparing to unpack .../nvidia-driver_535.183.01-1~deb12u1_amd64.deb ...
Unpacking nvidia-driver (535.183.01-1~deb12u1) ...
Setting up nvidia-driver-bin (535.183.01-1~deb12u1) ...
Processing triggers for nvidia-alternative (535.183.01-1~deb12u1) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/nvidia/current-open because link group nvidia is broken
Setting up nvidia-driver (535.183.01-1~deb12u1) ...
Processing triggers for glx-alternative-nvidia (1.2.2) ...
Processing triggers for glx-alternative-mesa (1.2.2) ...
Processing triggers for update-glx (1.2.2) ...
Processing triggers for libc-bin (2.36-9+deb12u7) ...
Processing triggers for glx-alternative-nvidia (1.2.2) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/nvidia/bumblebee because link group glx is broken
Processing triggers for libc-bin (2.36-9+deb12u7) ...
Processing triggers for initramfs-tools (0.142) ...
update-initramfs: Generating /boot/initrd.img-6.1.0-22-amd64
Processing triggers for bumblebee (3.2.1-29) ...

User avatar
@ttila
Posts: 176
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 20 times

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#9 Post by @ttila »

At the end, are modules compiled on your system?
Keep kernel headers installed for your current kernel and use 535 drivers not the old 470.
My 11years old laptop uses bumblebee, not yours. Use this guide.



EDIT: this is the path for the make.log file:

Code: Select all

/var/lib/dkms/nvidia-current/555.42.06/6.9.8-amd64/x86_64/log/make.log

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#10 Post by adonnini »

Thanks.

1) There is no make.log file on my system, anywhere, including in any of the directories under /var/lib/dkms. By the way, under /var/log/ I have an nvidia-current-open directory not nvidia-current.

2) Should I remove purge the 470 driver to be sure it is not used?

3) I have used the Debian NVIDIA Optimus guide many times, sections 3 and 6 as I do have bumblebee installed.

4) I don't think the modules are compiled on my system (isn't the fact that the driver is not loaded confirmation of that?). How can I manually compile it?

User avatar
@ttila
Posts: 176
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 20 times

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#11 Post by @ttila »

adonnini wrote: 2024-07-09 11:06 1) There is no make.log file on my system, anywhere, including in any of the directories under /var/lib/dkms. By the way, under /var/log/ I have an nvidia-current-open directory not nvidia-current.
It is strange, do you have kernel-headers installed for your current kernel? Which kernel are you using? Do you have the headers for your "running" kernel?
adonnini wrote: 2024-07-09 11:06 2) Should I remove purge the 470 driver to be sure it is not used?
Drivers are made to avoid multiple version of drivers, you should have only installed the 535 version.
adonnini wrote: 2024-07-09 11:06 3) I have used the Debian NVIDIA Optimus guide many times, sections 3 and 6 as I do have bumblebee installed.
Since drivers 470 you can use NVIDIA PRIME Render Offload, use this. Bumblebee is old and slow.
adonnini wrote: 2024-07-09 11:06 4) I don't think the modules are compiled on my system (isn't the fact that the driver is not loaded confirmation of that?). How can I manually compile it?
On my system, modules are stored in "/lib/modules/6.9.8-amd64/updates/dkms" and they are:

Code: Select all

nvidia-current-drm.ko.xz      nvidia-current-peermem.ko.xz
nvidia-current.ko.xz          nvidia-current-uvm.ko.xz
nvidia-current-modeset.ko.xz
dkms will build them for you, this is an advantage to use packaged drivers.

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#12 Post by adonnini »

Thanks.
I have the latest headers for the kernel I use.

Code: Select all

root@actlnxlpt7:/usr/src/nvidia-current-open-535.183.01# uname -r 
6.1.0-22-amd64
root@actlnxlpt7:/usr/src/nvidia-current-open-535.183.01# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-headers-6.1.0-22-amd64 is already the newest version (6.1.94-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
There is no updates directory in /lib/modules/6.1.0-22-amd64

User avatar
@ttila
Posts: 176
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 20 times

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#13 Post by @ttila »

Well, my idea is now to manually force dkms to compile and than install Nvidia modules. There are of plenty of guides, one of them is this.
Good luck :wink:

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#14 Post by adonnini »

Thanks.

I completely removed and reinstalled 6.1.0-22-amd64. This time /lib/modules/6.1.0-22-amd64 has a build and updates directory.

I followed the instructions in the document you linked above to force the reinstallation of the nvidia driver The following lines at the end of make.log caught my attention:

Code: Select all

dwarf_expr: unhandled 0x12 DW_OP_ operation
die__process_function: tag not supported 0x2f (template_type_parameter)!
Unsupported DW_TAG_reference_type(0x10)
Encountered error while encoding BTF.
Unsupported DW_TAG_reference_type(0x10)
Encountered error while encoding BTF.
make[3]: *** [/usr/src/linux-headers-6.1.0-22-common/scripts/Makefile.modfinal:61: /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia-modeset.ko] Error 1
make[3]: *** Deleting file '/var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia-modeset.ko'
  if [ ! -f vmlinux ]; then printf "Skipping BTF generation for %s due to unavailability of vmlinux
" /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia-uvm.ko 1>&2; else LLVM_OBJCOPY="objcopy" pahole -J --btf_gen_floats -j --lang_exclude=rust --btf_base vmlinux /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia-uvm.ko; ./tools/bpf/resolve_btfids/resolve_btfids -b vmlinux /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia-uvm.ko; fi;
  if [ ! -f vmlinux ]; then printf "Skipping BTF generation for %s due to unavailability of vmlinux
" /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia.ko 1>&2; else LLVM_OBJCOPY="objcopy" pahole -J --btf_gen_floats -j --lang_exclude=rust --btf_base vmlinux /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia.ko; ./tools/bpf/resolve_btfids/resolve_btfids -b vmlinux /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia.ko; fi;
/bin/sh: 1: ./tools/bpf/resolve_btfids/resolve_btfids: not found
make[3]: *** [/usr/src/linux-headers-6.1.0-22-common/scripts/Makefile.modfinal:61: /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia-uvm.ko] Error 127
make[3]: *** Deleting file '/var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia-uvm.ko'
/bin/sh: 1: ./tools/bpf/resolve_btfids/resolve_btfids: not found
make[3]: *** [/usr/src/linux-headers-6.1.0-22-common/scripts/Makefile.modfinal:61: /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia.ko] Error 127
make[3]: *** Deleting file '/var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia.ko'
make[2]: *** [/usr/src/linux-headers-6.1.0-22-common/Makefile:1950: modules] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-6.1.0-22-amd64'
make[1]: *** [Makefile:250: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.0-22-common'
make: *** [Makefile:82: modules] Error 2
No idea how to resolve the error.

User avatar
@ttila
Posts: 176
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 20 times

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#15 Post by @ttila »

adonnini wrote: 2024-07-09 21:21 ...........
No idea how to resolve the error.
Same for me, probably as @sunrat wrote your kernel is too old :( .
I use Trixie aka "Debian Testing", but i think you could backport a newer kernel enabling backport repo or open a ticket on the github page of Nvidia open kernel module.

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#16 Post by adonnini »

I upgraded to kernel 6.7.12+bpo-amd64, ran

Code: Select all

dkms build nvidia-current-open/535.183.01 --force
Execution failed as with the 6.1.94-1 kernel. Below you will find the portion of make.log with the error information.

Code: Select all

/bin/sh: 1: ./tools/bpf/resolve_btfids/resolve_btfids: not found
make[4]: *** [/usr/src/linux-headers-6.7.12+bpo-common/scripts/Makefile.modfinal:59: /var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia.ko] Error 127
make[4]: *** Deleting file '/var/lib/dkms/nvidia-current-open/535.183.01/build/nvidia.ko'
make[3]: *** [/usr/src/linux-headers-6.7.12+bpo-common/Makefile:1869: modules] Error 2
make[2]: *** [/usr/src/linux-headers-6.7.12+bpo-common/Makefile:246: __sub-make] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-6.7.12+bpo-amd64'
make[1]: *** [Makefile:246: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.7.12+bpo-common'
make: *** [Makefile:82: modules] Error 2

User avatar
@ttila
Posts: 176
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 20 times

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#17 Post by @ttila »

I did a fast search with the first row of your output:

Code: Select all

 ./tools/bpf/resolve_btfids/resolve_btfids: not found
and a I found out this solution.
There are several user with your same issue with different solutions. Just test them.

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#18 Post by adonnini »

Thanks. I searched for solutions to the problems before sending my latest post. There are many "solutions" so to speak. All of the ones I found point to bugs/problems with the Debian build. There is also an open bug about this.
I have been playing the "try" the solutions found on the Internet game for about a month now.
Thanks for your suggestions. I will try another way.
I think I would like to close this topic. I searched for a way to do that, not found any relevant information. Probably my fault.

adonnini
Posts: 11
Joined: 2024-07-08 10:53
Has thanked: 1 time

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#19 Post by adonnini »

Last update.

The problem on my system was caused by following these instructions:

https://wiki.debian.org/NvidiaGraphicsDrivers

They don't work (on my system).

Instead, simply running the bumblee-nvidia installation using Synaptics just worked.

User avatar
@ttila
Posts: 176
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 20 times

Re: Nvidia driver on Legion 9 with RTX 4090 won't load

#20 Post by @ttila »

Glad to read that finally you solved it. The bumblee packages use the Nouveau driver while the bumblebee-nvidia uses closed driver.
Well done @adonnini :mrgreen:!!!

Post Reply