我是在运行cuda C++程序时报的这个错误,
1.然后我运行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.
说明是cuda驱动找不到了,
2.但是使用nvcc -V
检查驱动和cuda。又存在
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
3.则运行 ls /usr/src | grep nvidia
显示nvidia-450.57
4.输入下面指令,这里用的版本号(450.57)要和上面第三步得到的(450.57)版本号一致,你是多少就写多少
sudo apt-get install dkms
sudo dkms install -m nvidia -v 450.57
5再次运行nvidia-smi,则能正常显示
6运行cuda C++程序也就没问题了