码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu 安装 cuda

时间:2020-01-28 17:47:15      阅读:907      评论:0      收藏:0      [点我收藏+]

标签:class   linu   develop   color   osi   eve   pip3   ane   lib64   

 

方法一: Run file 安装 


wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run
sudo sh cuda_10.
2.89_440.33.01_linux.run

 

=========================

方法二:Deb 安装

Download Installer for Linux Ubuntu 18.04 x86_64

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-2-local-10.2.89-440.33.01/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

 

环境变量

export CUDA_HOME=/usr/local/cuda-10.2
export CUDA_ROOT=/usr/local/cuda-10.2
export PATH=$PATH:$CUDA_HOME/bin:$CUDA_HOME/include:$CUDA_HOME
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH:$CUDA_HOME/include
export CUDA_INC_DIR=$CUDA_INC_DIR:$CUDA_HOME:$CUDA_HOME/include

 

pip3 install pycuda==2019.1.2 -i https://pypi.tuna.tsinghua.edu.cn/simple      #### 不要使用sudo,否则可能会报错

 

ubuntu 安装 cuda

标签:class   linu   develop   color   osi   eve   pip3   ane   lib64   

原文地址:https://www.cnblogs.com/cloudrivers/p/12238355.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!