以下是在崩掉后,重新启动,nvidia-smi出现的问题:
NVIDIA-SMI has failed because it couldn't communicate with NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
这里使用了sudo apt-get install dkms的方法后,依旧不可以,
所以,换一个办法:
首先查看驱动的版本号:
sudo dpkg --list | grep nvidia-*
输出结果:
ii libnvidia-cfg1-470:amd64 470.86-0ubuntu0.18.04.1 amd64 NVIDIA binary OpenGL/GLX configuration library
ii libnvidia-common-470 470.86-0ubuntu0.18.04.1 all Shared files used by the NVIDIA libraries
ii libnvidia-compute-470:amd64 470.86-0ubuntu0.18.04.1 amd64 NVIDIA libcompute package
ii libnvidia-compute-470:i386 470.86-0ubuntu0.18.04.1 i386 NVIDIA libcompute package
ii libnvidia-decode-470:amd64 470.86-0ubuntu0.18.04.1 amd64 NVIDIA Video Decoding runtime libraries
ii libnvidia-decode-470:i386 470.86-0ubuntu0.18.04.1 i386 NVIDIA Video Decoding runtime libraries
ii libnvidia-encode-470:amd64 470.86-0ubuntu0.18.04.1 amd64 NVENC Video Encoding runtime library
ii libnvidia-encode-470:i386 470.86-0ubuntu0.18.04.1 i386 NVENC Video Encoding runtime library
ii libnvidia-extra-470:amd64 470.86-0ubuntu0.18.04.1 amd64 Extra libraries for the NVIDIA driver
ii libnvidia-fbc1-470:amd64 470.86-0ubuntu0.18.04.1 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-fbc1-470:i386 470.86-0ubuntu0.18.04.1 i386 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-gl-470:amd64 470.86-0ubuntu0.18.04.1 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-gl-470:i386 470.86-0ubuntu0.18.04.1 i386 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-ifr1-470:amd64 470.86-0ubuntu0.18.04.1 amd64 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii libnvidia-ifr1-470:i386 470.86-0ubuntu0.18.04.1 i386 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii nvidia-compute-utils-470 470.86-0ubuntu0.18.04.1 amd64 NVIDIA compute utilities
ii nvidia-cuda-dev 9.1.85-3ubuntu1 amd64 NVIDIA CUDA development files
ii nvidia-cuda-doc 9.1.85-3ubuntu1 all NVIDIA CUDA and OpenCL documentation
ii nvidia-cuda-gdb 9.1.85-3ubuntu1 amd64 NVIDIA CUDA Debugger (GDB)
ii nvidia-cuda-toolkit 9.1.85-3ubuntu1 amd64 NVIDIA CUDA development toolkit
rc nvidia-dkms-470 470.86-0ubuntu0.18.04.1 amd64 NVIDIA DKMS package
ii nvidia-kernel-common-470 470.86-0ubuntu0.18.04.1 amd64 Shared files used with the kernel module
ii nvidia-kernel-source-470 470.86-0ubuntu0.18.04.1 amd64 NVIDIA kernel source package
ii nvidia-opencl-dev:amd64 9.1.85-3ubuntu1 amd64 NVIDIA OpenCL development files
ii nvidia-prime 0.8.16~0.18.04.1 all Tools to enable NVIDIA's Prime
ii nvidia-profiler 9.1.85-3ubuntu1 amd64 NVIDIA Profiler for CUDA and OpenCL
ii nvidia-settings 470.57.01-0ubuntu0.18.04.1 amd64 Tool for configuring the NVIDIA graphics driver
ii nvidia-utils-470 470.86-0ubuntu0.18.04.1 amd64 NVIDIA driver support binaries
ii nvidia-visual-profiler 9.1.85-3ubuntu1 amd64 NVIDIA Visual Profiler for CUDA and OpenCL
ii xserver-xorg-video-nvidia-470 470.86-0ubuntu0.18.04.1 amd64 NVIDIA binary Xorg driver
可以看出来我对应的是470.86。所以在文件夹中搜索:NVIDIA
找到对应版本的.run文件,即:NVIDIA-Linux-x86_64-470.63.01.run
,记住文件名以及位置。
开始手动安装驱动。
1 按ctrl+alt+F1(或者F2,F3,F4一直到F6)
2 输入登陆用户名以及密码
3 引导到刚才记住的目录下,
cd /Desktop/LH
4 关闭lightdm
sudo service lightdm stop
5 安装驱动,
sudo bash NVIDIA-Linux-x86_64-470.63.01.run
一直回车到结束。
6 打开lightdm
sudo service lightdm start
7 按ctrl+alt+F7回到桌面
8 在Terminal中输入nvidia-smi,就可以看到显卡信息啦
完成!