The installment of CUDA on Ubuntu18.04

Download mateched CUDA pattern on official website.
https://developer.nvidia.com/cuda-10.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=runfilelocal
check whether it is a right pattern

md5sum cuda_10.0.130_410.48_linux.run

First Step:

#install depent package

# 依赖库安装
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

Second Step:
downgradw the gcc and g++ pattern.

sudo apt-get install gcc-5
sudo apt-get install g++-5

go in to the item of /usr/bin:

cd /usr/bin
ls -l gcc*

change the link of gcc-7.0 to gcc-5

sudo mv gcc gcc.bak #copy
sudo ln -s gcc-5.0 gcc #link again

and then check and change g++ link pattern

ls -l g++*

change the g++ link into g+±5.0:

sudo mv g++ g++.bak
sudo ln -s g++-5 g++

check g++ and gcc pattern

gcc -v
g++ -v

authorize the run file and install CUDA package

sudo chmod +x cuda_10.0.130_410.48_linux.run
sudo ./cuda_10.0.130_410.48_linux.run

And then answer y at every end of question except for install NVIDIA drive.

sudo gedit ~/.bashrc

add the condition variables at the end of diologue frame. click the save button at up right cornor of frame.

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}  
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

At last implement the order mentioned blow

source ~/.bashrc
nvcc -V
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值