**[ This tutorial is old, please move here] **ubuntu16.04 install CUDA
**[ This tutorial is old, please move here] **ubuntu16.04 Install CUDA
**[ This tutorial is old, please move here] **ubuntu16.04 Install CUDA
**[ This tutorial is old, please move here] **ubuntu16.04 install CUDA
**[ This tutorial is old, please move here] **ubuntu16.04 install CUDA
[11.09.2016 Update, after updating the source, upgrade)
[11.07.2016 Update possible errors]
[10.16.2016 Update]
ubuntu 16.04 python 2.7 cuda7.5/Cuda8.0 tensorflow-gpu
Recently, I have been matching the framework of deep learning. After a week, I finally matched it. There were n detours in the middle.
The installation is introduced below:
1- > : Ready to work:
Install sshserver: ubuntu has no sshserver by default, only sshclient sudo apt-get install openssh-server openssh-client
To configure the source, it is best to use a domestic source in China because the download speed is fast. Introduction of domestic sources
Just add the source you want to use to the head of the /etc/apt/sources.list file
Then sudo apt-get update
sudo apt-get upgrade
Installation dependencies sudo apt-get install python-pip sudo apt-get install python-numpy swig python-dev python-wheel
sudo apt-get install git vim sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
2- >: Install nvidia driver:
I spent about 3.4 days here. I don’t want to be pitted. The main problem is that after installing the driver, I am stuck on the login interface and cannot enter. At the end I saw someone mentioned turning off Secury Boot, and then I turned it off before entering.
Add nouveau to the blacklist sudo vim /etc/modprobe.d/blacklist.conf Add blacklist nouveau to the end of the file
Restart the computer
Press Ctrl+Alt+F1 to enter the command line interface sudo service lightdm stop sudo rm /tmp/.X0-lock (delete this file, if there is no existing one, an error will be reported)
Sudo apt-get remove --purge nvidia-* sudo rm /etc/X11/xorg.cong sudo apt-add-repository ppa:graphics-drivers/ppa -y sudo apt-get update sudo apt-get install nvidia- 367 nvidia-settings nvidia-prime sudo apt-get install mesa-common-dev sudo apt-get install freeglut3-dev sudo ldconfig -n sudo update-initramfs -u
Restart the computer and you can enter the interface. If you can't enter, enter the BIOS startup page, find Security BOOT in Boot (or Security), and disable it.
View driver nvidia-smi will output graphics card information
3- > Install CUDA8.0
Download the CUDA8.0 .run file from the official website
cuda7.5 requires gcc-4.7 g++-4.7 to compile, and Ubuntu defaults to version 5.4, so you need to downgrade the version. If cuda8.0 does not need to downgrade sudo apt-get install gcc-4.7 g++-4.7 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 10 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 10 10 stands for priority, higher priority
Install CUDA7.5, you will be prompted unsorported configuration during installation, don't bother, and you will be asked whether you want to install the graphics card driver and select n.
chmod +x cuda7* sudo ./cuda7*
Configure the CUDA environment~$ sudo vim.bashrc Add export PATH=/usr/local/cuda/bin at the end of the file:
test
cd /usr/local/cuda-7.5/samples/1_Utilities/deviceQuery make sudo ./deviceQuery Test again and try nobody: cd ../../5_Simulations/nbody/ make Execute: ./nbody -benchmark -numbodies=256000- device=0
4- > Install cudnn4.0 Install cudnn5.1 (the official tensorflow0.10.0 is compiled with cuda7.5 and cudnn5.1)
5- > Install bazel (If you don’t plan to compile the source code to install tensorflow, you don’t need to install bazel. We don’t use source code to install tensorflow here.)
To install bazel, you need to install java8$ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer
Install bazel$ echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list $ curl https: //storage.googleapis.com/bazel-apt/doc/apt-key.pub.gpg | sudo apt-key add-$ sudo apt-get update && sudo apt-get install bazel $ sudo apt-get upgrade bazel
The bazel command needs to work in the workspace folder or its subfolders
6- > Install tensorflow
Or go to github to download the corresponding version, just use pip install file name
Then you can import tensorflow to test it
7- > Possible errors:
Error message:
Recommended Posts