Skip to content

Solving GPU Problems

In this article

After updating drivers or software in Ubuntu, an NVML error occurs: Driver/library version mismatch

If you encounter an error like Failed to initialize NVML: Driver/library version mismatch after installation, it is necessary to reconnect the Nvidia kernel modules by deleting them and running nvidia-smi again for reinitialization:

sudo rmmod -f nvidia-modeset
sudo rmmod nvidia_uvm
sudo rmmod nvidia_drm
sudo rmmod nvidia-peermem
sudo rmmod nvidia
sudo nvidia-smi

The error can also occur due to the /boot partition being full during simultaneous system kernel updates and an inability to build new initial RAM disks (initrd) with video card modules. To fix this, use this instruction.

If the error persists, it is recommended to remove Nvidia driver packages

sudo apt purge -s "nvidia*" "libnvidia*"
sudo apt autoremove
sudo apt --fix-broken install

and reinstall them (and CUDA) anew.

Nvidia Driver Installation: Kernel Modules Not Compiled

If you encounter an error during the installation of Nvidia drivers like this:

# command: 'make' -j128 KERNEL_UNAME=6.8.0-64-generic IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/6.8.0-64-generic/build LD=/usr/bin/ld.bfd CONFIG_X86_KERNEL_IBT= modules
Makefile:63: WARNING: Unable to locate the compiler x86_64-linux-gnu-gcc-12 from CONFIG_CC_VERSION_TEXT in the kernel configuration.
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-64-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
  You are using:           cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
  SYMLINK /var/lib/dkms/nvidia/575.57.08/build/nvidia/nv-kernel.o
  SYMLINK /var/lib/dkms/nvidia/575.57.08/build/nvidia-modeset/nv-modeset-kernel.o

it means that GCC version 12 is not installed on your system. Install it using the command:

sudo apt install gcc-12 g++-12

and reinstall them (and CUDA) again.

Nvidia Driver Installation Error: Unable to Sign Kernel Modules

During the installation of graphics card drivers, you might see an error that the system cannot find the update-secureboot-policy package and sign the modules, even though Secure Boot is disabled in BIOS:

Building initial module nvidia/575.57.08 for 6.8.0-64-generic
Sign command: /usr/bin/kmodsign
Binary update-secureboot-policy not found, modules won't be signed

To resolve this issue, install the shim-signed package with the command:

sudo apt install shim-signed

and reinstall them (and CUDA) again.


Some of the content on this page was created or translated using AI.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×