tags: gcc version
1. change your gcc version, in the ubuntu18.04, the gcc version is 7.3.0, but cuda can't support it now, so we will change it
sudo apt install gcc-5 g++-5
after that we use update-alternatives to manage gcc version
imagesudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 --slave /usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --config gcc
you can use this conmmand to show all package version
update-alternatives --list [package name]
tags: add PPA
2. add the PPA (Personal Package Archive) repository
sudo add-apt-repository ppa:graphics-drivers/ppa
check the recommended graphic driver
ubuntu-driver devices
then you will see like this
imageif you already install the graphic driver, then you can use "nvidia-smi" to see the graphic usage situation
imagetags: download cuda (this version is 9.1) && install it
3. this case use the cuda_9.1.85_387.26_linux.run, you can download this run file by the link below
then you can use sh commend to executing it
sudo sh XXX.run
pay attention, you musk reject installing the graphic driver!!!
after that add the path to the .bashrc
echo "export PATH=/usr/local/cuda-9.1/bin:$PATH" >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-9.1/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
英文很垃圾请见谅
网友评论