1、问题:
ubuntu 系统安装nvidia driver后,查看显卡信息显示failed。
报错信息:
#查看显卡信息
user@anonymous_address:~$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
#nvcc
user@anonymous_address:~$ nvcc -V
WARNING:root:could not open file '/etc/apt/sources.list'
Command 'nvcc' not found, but can be installed with:
sudo apt install nvidia-cuda-toolkit
#安装nvcc 工具
user@anonymous_address:~$ sudo apt install nvidia-cuda-toolkit
[sudo] didi 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
没有可用的软件包 nvidia-cuda-toolkit,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到
E: 软件包 nvidia-cuda-toolkit 没有可安装候选
2、解决方法:
1)清楚历史drivers,重新安装
# 卸载原有驱动
sudo apt-get purge nvidia*
# 查看匹配的驱动
ubuntu-drivers devices
# 自动安装驱动
sudo ubuntu-drivers autoinstall
# 安装完毕 -> reboot
sudo shutdown -r now
2)重启系统,执行perform mok managemnet:
重启后出现蓝屏的perform mok managemnet。 按照以下步骤进行:
- 选择enroll mok(perform mok mangement界面)
- 选择continue(enroll mok界面)
- 选择yes(enroll the key界面)
- 输入在安装时设定的密码
- 选择Reboot(perform mok manageent界面)
参考资料:Command ‘nvcc‘ not found, but can be installed with_Le0v1n的博客-优快云博客
在Ubuntu系统中,安装NVIDIA驱动后无法正常运行,nvidia-smi命令显示失败。尝试通过卸载旧驱动,使用`ubuntu-driversautoinstall`自动安装新驱动,但过程中遇到nvcc未找到且无法安装nvidia-cuda-toolkit的问题。解决方法包括清除历史驱动,自动安装,以及在重启后进行MOK管理以完成驱动的正确安装。
3449





