Cannot get nvidia driver (520, 515, 515-open, or 510) working in Ubuntu 22.10

I have tried everything to my knowledge. In past versions I have got the nvidia driver to work, however after upgrading my distro to 22.10 from 22.04, the additional drivers tab says that I have a driver ‘manually installed’. I cannot select any nvidia drivers.

What I tried:

  1. ubuntu-drivers install – no gpu detected after reboot with nvidia-smi
  2. apt install nvidia-driver-515 – no gpu detected, same as above

I am at a loss here. I have already uninstalled everything with

        sudo apt remove --purge '^nvidia-.*'
        sudo apt remove --purge '^libnvidia-.*'
        sudo rm /etc/X11/xorg.conf | true
        sudo rm /etc/X11/xorg.conf.d/90-nvidia-primary.conf
        sudo rm /usr/share/X11/xorg.conf.d/10-nvidia.conf
        sudo rm /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf

I have also ran
grep blacklist /etc/modprobe.d/* /lib/modprobe.d/* | grep nvidia
and confirmed that there is no output.

As far as I can tell, I am running nouveau:

  *-display                 
       description: VGA compatible controller
       product: TU104 [GeForce RTX 2080 Rev. A] [10DE:1E87]
       vendor: NVIDIA Corporation [10DE]
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: /dev/fb0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=nouveau latency=0 resolution=2560,1440
       resources: irq:147 memory:a3000000-a3ffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:3000(size=128) memory:c0000-dffff

but the additional drivers tab still wont allow me to select anything!

Additional information:
ls -l /usr/lib/x86_64-linux-gnu/libnvidia* returns no files
ls -l /usr/lib/x86_64-linux-gnu/libcuda* returns no files
dpkg -l | grep nvidia returns nothing

Any help is appreciated, the only other thing I can think of is reinstalling my OS, which I do not want to do. This nvidia driver installation has never been easy for me but usually Ive been able to get it working after a few hours of trying things.

3 Likes

Update. I tried doing some more installs, but now anytime I install a nvidia driver my system no longer boots. I am able to boot fine with nouveau, and the additional software and drivers tab of the software updater still reports I am using a manually installed driver when this cant be possible.

$ neofetch
OS: Linux Mint 21 x86_64 
Host: Dell G15 5520 
Kernel: 5.15.0-52-generic 
Resolution: 1920x1080, 1920x1080 
DE: Cinnamon 5.4.12 
WM: Mutter 
WM Theme: Mint-Y 
CPU: 12th Gen Intel i5-12500H (16) @ 4.500GHz
GPU: NVIDIA GeForce RTX 3050 Mobile 
GPU: Intel Alder Lake-P 
Memory: 1813MiB / 7633MiB

I had the same issue when I went to a kernel higher than 5.15.0-48-generic. I was finding that if I selected recovery mode from grub, then resume, I was able to boot into 5.15.0-52-generic just fine. I found on a redit post (Sorry, didn’t save the link), which said to add “nomodeset” to /etc/default/grub on the GRUB_CMDLINE_LINUX_DEFAULT line at the end of the line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

… which worked for me.

Interesting. Even with your suggestion I just cannot boot with nvidia drivers installed.

1 Like

Update. I have tried:

Install 6.0.5 kernel:

  • Install nvidia-driver-520
  • Install nvidia-driver-515

Neither of these work. It seems only nouveau works for me, which isn’t really an option since I am using this pc for gaming. I am lost at this point as to what to do.

Hi Christian,

have you try this solution?

I use this wit my old Powerbook 17 with elementary os and it’s work fine…

sudo add-apt-repository ppa:kelebek333/nvidia-legacy
sudo apt-get update
sudo apt-get install xorg-modulepath-fix

Davide

Hi Davide, I am able to select the nvidia drivers after updating my kernel, but my pc wont boot with them still after the installation says its done.

Ill do a final ask to @generix . Do you require anything to help troubleshoot my problem?

Hi Christian,

my english is not good, apologize

my ubuntu problem it’s the same too

try to do this

  1. choose your distro
  2. reinstall(*) your machine ignoring video driver, and configure internet connection
  3. once installed via cli before any upgrade

use this command

sudo add-apt-repository ppa:kelebek333/nvidia-legacy
sudo apt-get update
sudo apt-get install xorg-modulepath-fix


then reboot

the machine goes up with Nvidia driver enabled. 




(*) if you prefer, try to uninstall all Nvidia driver....



regards
davide

------- Messaggio originale -------

Hi Davide, I will use a reinstall as a last resort. I think I would prefer to wait and see if anyone has a fix for my system as it is, or if ubuntu issues a fix. Thanks for your recommendations, I will try this on my next install

@generix Attached is the nvidia bug file:
nvidia-bug-report.log.gz (109.0 KB)

same here.

Fresh 22.04.1 LTS minimal install.

Everything works. Installed Cuda 11.8 from

CUDA Toolkit 11.8 Downloads | NVIDIA Developer?
target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_network

computer no longer can switch into gfx mode. black screen

RTX 3090/24GB, 4k screen FWIW

dmesg | grep nvidia

[ 6.586177] audit: type=1400 audit(1666889550.795:6): apparmor=“STATUS” operation=“profile_load” profile=“unconfined” name=“nvidia_modprobe” pid=564 comm=“apparmor_parser”
[ 6.586179] audit: type=1400 audit(1666889550.795:7): apparmor=“STATUS” operation=“profile_load” profile=“unconfined” name=“nvidia_modprobe//kmod” pid=564 comm=“apparmor_parser”
[ 7.258596] nvidia: loading out-of-tree module taints kernel.
[ 7.258603] nvidia: module license ‘NVIDIA’ taints kernel.
[ 7.284772] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[ 7.295818] nvidia-nvlink: Nvlink Core is being initialized, major device number 510
[ 7.296672] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[ 8.165302] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 520.61.05 Thu Sep 29 05:29:37 UTC 2022
[ 8.330554] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[ 8.330556] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0
[ 8.349288] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[ 8.977870] nvidia-uvm: Loaded the UVM driver, major device number 508.
[ 12.597016] nvidia-modeset: WARNING: GPU:0: Lost display notification (0:0x00000000); continuing.
[ 220.974329] nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device LG Electronics LG HDR 4K (HDMI-1)

Last time I made things work via 510 but had to remove nouveau first (if I am not mistaken, don’t take my word for it)

grub change suggested here did not address the issue.

Thought I’d try an older CUDA install. But also 11.6.2 shows the same result.
Fresh Ubuntu install, of course.

@christianboin > module: x86/modules: Skipping invalid relocation target
Your build system is broken, producing broken kernel modules. Did you install a different linker, e.g. mold instead of gnu ld?

@generix Not that I know of. I had this same error in Ubuntu 22.04, but didnt think anything of it because I was able to get the drivers to work, albeit it was a huge pain.

Is there a fix for something like this?

First measure would be remove and reinstall kernel headers, then use dkms to revove /install the modules and use modprobe to see if they load.

Sorry I am a bit new to this stuff. Reinstalling kernel headers is:

‘sudo apt install —reinstall linux-headers-$(uname -r)’

To remove kernel modules, do you mean make sure no nvidia modules appear with ‘dkms status’

And lastly, to check with modprobe…

‘sudo modprobe nvidia’

I assume I should just reinstall the 520 driver through the ‘additional drivers tab’ and then do all these steps before trying a reboot?

@generix

kernel headers/modprobe, like you said.
dkms to recompile nvidia modules
dkms status
to see what modules are installed, if none, that’s bad
sudo dkms remove nvidia/(version number)
to remove followed by
sudo dkms install nvidia/(version number)
to recompile the modules.

@generix and I should install the driver first obviously, through the additional drivers tab in ubuntu? Then run all your steps, or reboot and then run the steps from the recovery mode (since my desktop GUI will not load)

Install the driver but don’t reboot. Then check if you can modprobe the driver, if not do the other steps.

OK @generix So I did the following.

  1. install nvidia 520.56.06 from the additional drivers tab
  2. sudo modprobe nvidia → returns => modprobe: ERROR: could not insert 'nvidia': Exec format error
  3. sudo apt install --reinstall linux-headers-$(uname -r) → returns →
Reading package lists... Done                                                                                                               
Building dependency tree... Done                                                                                                            
Reading state information... Done                                                                                                           
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.                                                               
Need to get 3,270 kB of archives.                                                                                                           
After this operation, 0 B of additional disk space will be used.                                                                            
Get:1 http://ca.archive.ubuntu.com/ubuntu kinetic-updates/main amd64 linux-headers-5.19.0-23-generic amd64 5.19.0-23.24 [3,270 kB]          
Fetched 3,270 kB in 0s (8,824 kB/s)                                                                                                         
(Reading database ... 523239 files and directories currently installed.)                                                                    
Preparing to unpack .../linux-headers-5.19.0-23-generic_5.19.0-23.24_amd64.deb ...                                                          
Unpacking linux-headers-5.19.0-23-generic (5.19.0-23.24) over (5.19.0-23.24) ...                                                            
Setting up linux-headers-5.19.0-23-generic (5.19.0-23.24) ...                                                                               
/etc/kernel/header_postinst.d/dkms:                                                                                                         
 * dkms: running auto installation service for kernel 5.19.0-23-generic                                                                     
   ...done. 
  1. dkms status → returns →
nvidia/520.56.06, 5.19.0-23-generic, x86_64: installed (WARNING! Diff between built and installed module!)                                  
nvidia/520.56.06, 6.0.5-060005-generic, x86_64: installed                                                                                   
openrazer-driver/3.4.0, 5.19.0-23-generic, x86_64: installed                                                                                
openrazer-driver/3.4.0, 6.0.5-060005-generic, x86_64: installed 
  1. sudo dkms remove nvidia/520.56.06
Module nvidia-520.56.06 for kernel 5.19.0-23-generic (x86_64).                                                                              
Before uninstall, this module version was ACTIVE on this kernel.                                                                            
                                                                                                                                            
nvidia.ko:                                                                                                                                  
 - Uninstallation                                                                                                                           
   - Deleting from: /lib/modules/5.19.0-23-generic/                                                                                         
rmdir: failed to remove '': No such file or directory                                                                                       
 - Original module                                                                                                                          
   - No original module was found for this module on this kernel.                                                                           
   - Use the dkms install command to reinstall any previous module version.                                                                 
                                                                                                                                            
nvidia-modeset.ko:                                                                                                                          
 - Uninstallation                                                                                                                           
   - Deleting from: /lib/modules/5.19.0-23-generic/updates/dkms/                                                                            
 - Original module                                                                                                                          
   - No original module was found for this module on this kernel.                                                                           
   - Use the dkms install command to reinstall any previous module version.

nvidia-drm.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.19.0-23-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-uvm.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.19.0-23-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-peermem.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.19.0-23-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod...
  1. sudo dkms install nvidia/520.56.06
Sign command: /usr/lib/linux-kbuild-5.19/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Binary kmod-sign not found, modules won't be signed

Building module:
Cleaning build area...
unset ARCH; [ ! -h /usr/bin/cc ] && export CC=/usr/bin/gcc; env NV_VERBOSE=1 'make' -j8 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.19.0-23-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/5.19.0-23-generic/build LD=/usr/bin/ld.bfd CONFIG_X86_KERNEL_IBT= modules..........
Cleaning build area...

nvidia.ko:
Running module version sanity check.
Error! Module version 520.56.06 for nvidia.ko
is not newer than what is already found in kernel 5.19.0-23-generic (520.56.06).
You may override by specifying --force.

nvidia-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.19.0-23-generic/updates/dkms/

nvidia-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.19.0-23-generic/updates/dkms/

nvidia-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.19.0-23-generic/updates/dkms/

nvidia-peermem.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.19.0-23-generic/updates/dkms/
depmod...
  1. sudo modprobe nvidia
modprobe: ERROR: could not insert 'nvidia': Exec format error