ubuntu18.04安装CUDA10.0
生活随笔
收集整理的這篇文章主要介紹了
ubuntu18.04安装CUDA10.0
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、更新驅動
對于CUDA10.0,要求驅動版本大于410.48,因此首先要更新驅動
ubuntu-drivers devices(查看所有驅動)
sudo ubuntu-drivers autoinstall(自動安裝最適合的驅動)
查看驅動版本
nvidia-smi
2、下載CUDA10.0
https://developer.nvidia.com/cuda-toolkit-archive
選擇10.0版本后,進行如下選擇
下載這個2.0G的。
3、安裝
- 將下載的包復制到主目錄下
- 運行以下命令
chmod 777 cuda_10.0.130_410.48_linux.run
sudo ./cuda_10.0.130_410.48_linux.run
- 在終端中根據提示一步一步操作,如下所示,這里面特別要留意:不要安裝顯卡驅動。
Do you accept the previously read EULA?
accept/decline/quit: acceptInstall NVIDIA Accelerated Graphics Driver for Linux-x86_64 410.48?
(y)es/(n)o/(q)uit: nInstall the CUDA 10.0 Toolkit?
(y)es/(n)o/(q)uit: yEnter Toolkit Location[ default is /usr/local/cuda-10.0 ]: Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: yInstall the CUDA 10.0 Samples?
(y)es/(n)o/(q)uit: yEnter CUDA Samples Location[ default is /home/test ]: Installing the CUDA Toolkit in /usr/local/cuda-10.0 ...
- 安裝結束,終端中會顯示如下信息:
Installing the CUDA Toolkit in /usr/local/cuda-10.0 ...
Missing recommended library: libGLU.so
Missing recommended library: libX11.so
Missing recommended library: libXi.so
Missing recommended library: libXmu.soInstalling the CUDA Samples in /home/test ...
Copying samples to /home/test/NVIDIA_CUDA-10.0_Samples now...
Finished copying samples.===========
= Summary =
===========Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-10.0
Samples: Installed in /home/test, but missing recommended librariesPlease make sure that- PATH includes /usr/local/cuda-10.0/bin- LD_LIBRARY_PATH includes /usr/local/cuda-10.0/lib64, or, add /usr/local/cuda-10.0/lib64 to /etc/ld.so.conf and run ldconfig as rootTo uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-10.0/binPlease see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-10.0/doc/pdf for detailed information on setting up CUDA.***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 10.0 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:sudo <CudaInstaller>.run -silent -driverLogfile is /tmp/cuda_install_8442.log
- 安裝缺失的包
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
4、配置環境變量
sudo gedit ~/.bashrc
- 在末尾寫入
# for CUDA 10.0
export CUDA_10_0_HOME=/usr/local/cuda-10.0
export PATH=$PATH:$CUDA_10_0_HOME/bin
export LD_LIBRARY_PATH=CUDA_10_0_HOME/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- 運行環境變量
source ~/.bashrc
5、驗證
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
./deviceQuery
nvcc --version
cat /usr/local/cuda/version.txt
總結
以上是生活随笔為你收集整理的ubuntu18.04安装CUDA10.0的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 红颜来相聚是哪首歌啊?
- 下一篇: 心里有多苦是哪首歌啊?