赞
踩
nvidia-smi命令失效,显示NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver
驱动崩了,重新安装驱动即可
先找到之前安装的nvidia驱动版本号
ls /usr/src | grep nvidia
然后对应安装
sudo apt install dkms
sudo dkms install -m nvidia -v 418.87.00#这里的数字替换成查找到的nvidia版本号
安装未成功,报错显示
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
'make' -j32 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.4.0-91-generic IGNORE_CC_MISMATCH='' modules...(bad exit status: 2)
ERROR (dkms apport): binary package for nvidia: 450.80.02 not found
Error! Bad return status for module build on kernel: 5.4.0-91-generic (x86_64)
Consult /var/lib/dkms/nvidia/450.80.02/build/make.log for more information.
即编译出错,点击make.log查看
Compiler version check failed:
The major and minor number of the compiler used to
compile the kernel:
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
does not match the compiler used here:
cc (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
搜索网上其他博客,大致的问题一致,都是编译要求的gcc版本和当前版本不一致导致。
解决方法即为重新安装合适版本的gcc
其他博客的解决方法:
https://blog.csdn.net/hizengbiao/article/details/103698560
https://www.cnblogs.com/zzc-Andy/p/15069673.html?ivk_sa=1024320u
我的安装gcc的方法如下
sudo apt-get update
sudo apt-get install gcc-7
sudo apt-get install g++-7
cd /usr/bin
sudo rm gcc g++
sudo ln -s gcc-7 gcc
sudo ln -s g++-7 g++
gcc -v#查看安装版本是否成功
然后再按照第一节的命令重新安装驱动即可
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。