版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
安装cuda 9.0到阿里云ubunut 16.04总是报告错误,尝试了各种办法也无解:
Installing the NVIDIA display driver...
The driver installation is unable to locate the kernel source. Please make sure that the kernel source packages are installed and set up correctly.
If you know that the kernel source packages are installed and set up correctly, you may pass the location of the kernel source with the '--kernel-source-path' flag.
===========
= Summary =
===========
Driver: Installation Failed
Toolkit: Installation skipped
Samples: Not Selected
Logfile is /tmp/cuda_install_24139.log
root@iZbp1hh9ibnz9gvys5xy8nZ:~# more /tmp/cuda_install_24139.log
Using more to view the EULA.
看看了日志“/tmp/cuda_install_24139.log”才知道是编译内核出错,根本不是找不到kernel source!!!
换了最新的cuda10就编译通过了,无fuck可说!
root@iZbp1hh9ibnz9gvys5xy8nZ:~# sh cuda_10.1.243_418.87.00_linux.run
===========
= Summary =
===========
Driver: Installed
Toolkit: Installed in /usr/local/cuda-10.1/
Samples: Not Selected
Please make sure that
- PATH includes /usr/local/cuda-10.1/bin
- LD_LIBRARY_PATH includes /usr/local/cuda-10.1/lib64, or, add /usr/local/cuda-10.1/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-10.1/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall
Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-10.1/doc/pdf for detailed information on setting up CUDA.
Logfile is /var/log/cuda-installer.log
root@iZbp1hh9ibnz9gvys5xy8nZ:~#
finally:
root@iZbp1hh9ibnz9gvys5xy8nZ:~# nvidia-smi
Sat Aug 31 23:52:06 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.87.00 Driver Version: 418.87.00 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla P100-PCIE... Off | 00000000:00:08.0 Off | 0 |
| N/A 29C P0 25W / 250W | 0MiB / 16280MiB | 5% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+