- Ubuntu 16.04上安裝CUDA-8.0:工具包的版本是8.0
- Ubuntu 16.04只用內顯而不用獨顯:驅動的版本是375
到CUDA Toolkit 9.1 Download下載deb (local)檔案,再依序執行:
- sudo dpkg -i cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64.deb
- sudo apt-key add /var/cuda-repo-9-1-local/7fa2af80.pub
- sudo apt-get update
- export LD_PRELOAD=/usr/lib/nvidia-387/libnvidia-ml.so
- apt-get install cuda
- 把工具包的東西解開到系統硬碟上
這步驟好像會加入Nvidia驅動387版本的library到/usr/lib/nvidia-387上面 - 加入工具包的PGP public key,這樣apt-get就可以用了
- 更新APT(Advanced Package Tool)
- 由於我的系統一直抱怨找不到正確的版本libnvidia-ml.so,錯誤訊息如下
ERROR: ld.so: object '/usr/lib/nvidia-384/libnvidia-ml.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
需要這行指令,下面的安裝指令才能順利執行 - 安裝CUDA 9.1 Toolkit
DKMS: install completed.
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
Setting up nvidia-387-dev (387.26-0ubuntu1) ...
Setting up libcuda1-387 (387.26-0ubuntu1) ...
Setting up nvidia-opencl-icd-387 (387.26-0ubuntu1) ...
Setting up cuda-drivers (387.26-1) ...
Setting up cuda-runtime-9-1 (9.1.85-1) ...
Setting up cuda-demo-suite-9-1 (9.1.85-1) ...
Setting up cuda-9-1 (9.1.85-1) ...
Setting up cuda (9.1.85-1) ...
Processing triggers for initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: Generating /boot/initrd.img-4.13.0-32-generic
export PATH=/usr/local/cuda-9.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export LD_PRELOAD=/usr/lib/nvidia-387/libnvidia-ml.so
如果都沒有問題,那麼就重新開機~再用下面指令檢查成果:
- modinfo nvidia_387
- nvidia-smi
- 其他監控指令參考《監控Nvidia顯示卡》
沒有留言:
張貼留言