【Failed to initialize NVML: Driver/library version mismatch(已解决)】

【解决问题:Failed to initialize NVML: Driver/library version mismatch】

首先需要查看驱动内核版本,终端输入:

cat /proc/driver/nvidia/version

在这里插入图片描述
比如我这里显示的是440.100,记住这个数字;然后卸载驱动,终端输入:

sudo apt-get purge nvidia*

终端输入:

sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update

最后重新安装驱动,需要将“440”替换成刚才查到的版本号:

sudo apt-get install nvidia-driver-440 nvidia-settings nvidia-prime

hlx2@NLP:~/桌面/pycharm-community-2018.2.3/bin$ sudo apt-get install nvidia-driver-440 nvidia-settings nvidia-prime
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
E: 无法定位软件包 nvidia-driver-440

下载安装:

sudo systemctl stop lightdm

sudo sh NVIDIA-Linux-x86_64-440.82.run

There appears to already be a driver installed on your system (version:      
  440.82).  As part of installing this driver (version: 440.82), the existing  
  driver will be uninstalled.  Are you sure you want to continue?
选择 Continue installation

The distribution-provided pre-install script failed!  Are you sure you want
  to continue?
选择  Continue installation

WARNING: Unable to find a suitable destination to install 32-bit
           compatibility libraries. Your system may not be set up for 32-bit
           compatibility. 32-bit compatibility files will not be installed; if
           you wish to install them, re-run the installation and set a valid
           directory with the --compat32-libdir option.
选择 ok
Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later?
选择 No  继续。
问题大概是:Nvidia’s 32-bit compatibility libraries?
选择 No  继续。
Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up.
选择 Yes  继续

https://www.nvidia.cn/geforce/drivers/

搜索结果往下拉....

禁用更新:

sudo apt-mark hold nvidia-driver-440

到这里就OK了,终端输入nvidia-smi看一下是否出现了显卡信息,有的话大功告成!

参考链接:Ubuntu中Failed to initialize NVML: Driver/library version mismatch问题的解决

https://blog.csdn.net/anyang1996/article/details/107937898

猜你喜欢

转载自blog.csdn.net/qq_27009517/article/details/112982852