当前位置:   article > 正文

Linux-Ubuntu22.04,【nvidia-smi】Failed to initialize NVML: Driver/library version mismatch解决方法_nvidia-kernel-common-535

nvidia-kernel-common-535

1.系统:Ubuntu 22.04.3 LTS(64-bit)

2.问题:昨天还能正常使用,可查看显卡版本。今天就提示版本不匹配,怀疑是昨天装了cuda?但是cuda应该不会影响显卡驱动。

于是,查看了驱动版本dpkg -l | grep nvidia

  1. (base) fzx@fzx-System-Product-Name:~$ dpkg -l | grep nvidia
  2. ii libnvidia-cfg1-530:amd64 530.30.02-0ubuntu1 amd64 NVIDIA binary OpenGL/GLX configuration library
  3. ii libnvidia-common-530 530.30.02-0ubuntu1 all Shared files used by the NVIDIA libraries
  4. ii libnvidia-compute-530:amd64 530.30.02-0ubuntu1 amd64 NVIDIA libcompute package
  5. ii libnvidia-compute-530:i386 530.30.02-0ubuntu1 i386 NVIDIA libcompute package
  6. rc libnvidia-compute-535:amd64 535.113.01-0ubuntu0.22.04.3 amd64 NVIDIA libcompute package
  7. ii libnvidia-decode-530:amd64 530.30.02-0ubuntu1 amd64 NVIDIA Video Decoding runtime libraries
  8. ii libnvidia-decode-530:i386 530.30.02-0ubuntu1 i386 NVIDIA Video Decoding runtime libraries
  9. ii libnvidia-encode-530:amd64 530.30.02-0ubuntu1 amd64 NVENC Video Encoding runtime library
  10. ii libnvidia-encode-530:i386 530.30.02-0ubuntu1 i386 NVENC Video Encoding runtime library
  11. ii libnvidia-extra-530:amd64 530.30.02-0ubuntu1 amd64 Extra libraries for the NVIDIA driver
  12. ii libnvidia-fbc1-530:amd64 530.30.02-0ubuntu1 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
  13. ii libnvidia-fbc1-530:i386 530.30.02-0ubuntu1 i386 NVIDIA OpenGL-based Framebuffer Capture runtime library
  14. ii libnvidia-gl-530:amd64 530.30.02-0ubuntu1 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
  15. ii libnvidia-gl-530:i386 530.30.02-0ubuntu1 i386 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
  16. rc linux-modules-nvidia-535-6.2.0-26-generic 6.2.0-26.26~22.04.1+2 amd64 Linux kernel nvidia modules for version 6.2.0-26
  17. rc linux-modules-nvidia-535-6.2.0-35-generic 6.2.0-35.35~22.04.1 amd64 Linux kernel nvidia modules for version 6.2.0-35
  18. ii linux-objects-nvidia-535-6.2.0-26-generic 6.2.0-26.26~22.04.1+2 amd64 Linux kernel nvidia modules for version 6.2.0-26 (objects)
  19. ii linux-objects-nvidia-535-6.2.0-35-generic 6.2.0-35.35~22.04.1 amd64 Linux kernel nvidia modules for version 6.2.0-35 (objects)
  20. ii linux-signatures-nvidia-6.2.0-26-generic 6.2.0-26.26~22.04.1+2 amd64 Linux kernel signatures for nvidia modules for version 6.2.0-26-generic
  21. ii linux-signatures-nvidia-6.2.0-35-generic 6.2.0-35.35~22.04.1 amd64 Linux kernel signatures for nvidia modules for version 6.2.0-35-generic
  22. ii nvidia-compute-utils-530 530.30.02-0ubuntu1 amd64 NVIDIA compute utilities
  23. rc nvidia-compute-utils-535 535.113.01-0ubuntu0.22.04.3 amd64 NVIDIA compute utilities
  24. ii nvidia-dkms-530 530.30.02-0ubuntu1 amd64 NVIDIA DKMS package
  25. ii nvidia-driver-530 530.30.02-0ubuntu1 amd64 NVIDIA driver metapackage
  26. ii nvidia-firmware-535-535.113.01 535.113.01-0ubuntu0.22.04.3 amd64 Firmware files used by the kernel module
  27. ii nvidia-firmware-535-535.86.05 535.86.05-0ubuntu0.22.04.1 amd64 Firmware files used by the kernel module
  28. ii nvidia-kernel-common-530 530.30.02-0ubuntu1 amd64 Shared files used with the kernel module
  29. rc nvidia-kernel-common-535 535.113.01-0ubuntu0.22.04.3 amd64 Shared files used with the kernel module
  30. ii nvidia-kernel-source-530 530.30.02-0ubuntu1 amd64 NVIDIA kernel source package
  31. ii nvidia-modprobe 530.30.02-0ubuntu1 amd64 Load the NVIDIA kernel driver and create device files
  32. ii nvidia-prime 0.8.17.1 all Tools to enable NVIDIA's Prime
  33. ii nvidia-settings 530.30.02-0ubuntu1 amd64 Tool for configuring the NVIDIA graphics driver
  34. ii nvidia-utils-530 530.30.02-0ubuntu1 amd64 NVIDIA driver support binaries
  35. ii screen-resolution-extra 0.18.2 all Extension for the nvidia-settings control panel
  36. ii xserver-xorg-video-nvidia-530 530.30.02-0ubuntu1 amd64 NVIDIA binary Xorg driver

可以看出驱动版本是530.30.02 

内核版本是 535.113.01

  1. (base) fzx@fzx-System-Product-Name:~$ cat /proc/driver/nvidia/version
  2. NVRM version: NVIDIA UNIX x86_64 Kernel Module 535.113.01 Tue Sep 12 19:41:24 UTC 2023
  3. GCC version:

查看系统驱动日志,确实有更新

  1. (base) fzx@fzx-System-Product-Name:~$ cat /var/log/dpkg.log | grep nvidia
  2. 2023-10-22 01:20:29 install nvidia-prime:all <none> 0.8.17.1
  3. 2023-10-22 01:20:29 status half-installed nvidia-prime:all 0.8.17.1
  4. 2023-10-22 01:20:29 status unpacked nvidia-prime:all 0.8.17.1
  5. 2023-10-22 01:20:29 configure nvidia-prime:all 0.8.17.1 <none>
  6. 2023-10-22 01:20:29 status unpacked nvidia-prime:all 0.8.17.1
  7. 2023-10-22 01:20:29 status half-configured nvidia-prime:all 0.8.17.1
  8. 2023-10-22 01:20:29 status installed nvidia-prime:all 0.8.17.1
  9. 2023-10-22 18:04:57 status installed nvidia-driver-535:amd64 535.113.01-0ubuntu0.22.04.3
  10. 2023-10-22 18:04:57 remove nvidia-driver-535:amd64 535.113.01-0ubuntu0.22.04.3 <none>
  11. 2023-10-22 18:04:57 status half-configured nvidia-driver-535:amd64 535.113.01-0ubuntu0.22.04.3
  12. 2023-10-22 18:04:57 status half-installed nvidia-driver-535:amd64 535.113.01-0ubuntu0.22.04.3
  13. 2023-10-22 18:04:57 status config-files nvidia-driver-535:amd64 535.113.01-0ubuntu0.22.04.3
  14. 2023-10-22 18:04:57 status not-installed nvidia-driver-535:amd64 <none>
  15. 2023-10-22 18:04:57 status installed xserver-xorg-video-nvidia-535:amd64 535.113.01-0ubuntu0.22.04.3
  16. 2023-10-22 18:04:57 remove xserver-xorg-video-nvidia-535:amd64 535.113.01-0ubuntu0.22.04.3 <none>
  17. 2023-10-22 18:04:57 status half-configured xserver-xorg-video-nvidia-535:amd64 535.113.01-0ubuntu0.22.04.3
  18. 2023-10-22 18:04:57 status half-installed xserver-xorg-video-nvidia-535:amd64 535.113.01-0ubuntu0.22.04.3
  19. 2023-10-22 18:04:57 status config-files xserver-xorg-video-nvidia-535:amd64 535.113.01-0ubuntu0.22.04.3

 

3.原因:内核驱动更新导致的版本不一致

4.解决方案:

卸载驱动,重新安装

(1)卸载命令,全部粘贴,执行,一直输入y,直到执行完毕。

  1. sudo /usr/bin/nvidia-uninstall
  2. sudo apt-get --purge remove nvidia-*
  3. sudo apt-get purge nvidia*
  4. sudo apt-get purge libnvidia*

(2)查看显卡还剩余的驱动,sudo dpkg --list | grep nvidia-* 或者dpkg -l | grep nvidia,按当前版本重新安装

  1. (base) fzx@fzx-System-Product-Name:/$ sudo dpkg --list | grep nvidia-*
  2. ii libnvidia-compute-530:i386 530.30.02-0ubuntu1 i386 NVIDIA libcompute package
  3. ii libnvidia-decode-530:i386 530.30.02-0ubuntu1 i386 NVIDIA Video Decoding runtime libraries
  4. ii libnvidia-encode-530:i386 530.30.02-0ubuntu1 i386 NVENC Video Encoding runtime library
  5. ii libnvidia-fbc1-530:i386 530.30.02-0ubuntu1 i386 NVIDIA OpenGL-based Framebuffer Capture runtime library
  6. rc linux-modules-nvidia-535-6.2.0-26-generic 6.2.0-26.26~22.04.1+2 amd64 Linux kernel nvidia modules for version 6.2.0-26
  7. rc linux-modules-nvidia-535-6.2.0-35-generic 6.2.0-35.35~22.04.1 amd64 Linux kernel nvidia modules for version 6.2.0-35
  8. ii linux-objects-nvidia-535-6.2.0-26-generic 6.2.0-26.26~22.04.1+2 amd64 Linux kernel nvidia modules for version 6.2.0-26 (objects)
  9. ii linux-objects-nvidia-535-6.2.0-35-generic 6.2.0-35.35~22.04.1 amd64 Linux kernel nvidia modules for version 6.2.0-35 (objects)
  10. ii linux-signatures-nvidia-6.2.0-26-generic 6.2.0-26.26~22.04.1+2 amd64 Linux kernel signatures for nvidia modules for version 6.2.0-26-generic
  11. ii linux-signatures-nvidia-6.2.0-35-generic 6.2.0-35.35~22.04.1 amd64 Linux kernel signatures for nvidia modules for version 6.2.0-35-generic
  12. ii screen-resolution-extra 0.18.2 all Extension for the nvidia-settings control panel

(3)驱动下载链接:旧版下载地址:https://www.nvidia.cn/Download/Find.aspx?lang=cn

 选择对应版本下载

(4)安装新驱动

bash NVIDIA-Linux-x86_64-530.30.02.run
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号