Ubuntu installation TensorFlow-gpu and cuda9.0 (not trouble yourself)

It seems you must write a summary, reach their own Gaosi, it is necessary to sum up the pit

For a version control is concerned, everything should be the pursuit of a higher version, so I first installed a Ubuntu18.10, then normal installation pip3, then pip3 install tensorflow-gpu, installing a 1.12.0 version tensorflow-gpu's, everything looks nice, and then import tensorflow newspaper can not find libcublas.so.9.0, considered as the beginning of a nightmare

Originally I thought I could use apt to install, but wait until auto-complete when, sudo apt install libcublas9.1, right, not to the official version 9.0, but the 9.1 version

Download it from the official website, https://developer.nvidia.com/cuda-downloads , I write this article, this page gives the cuda10.0, following a button Legacy Releases, enter the version of history, select CUDA Toolkit 9.0, Linux, x86_64, Ubuntu, 16.04, runfile (local), to download the file, here mention that, when installed cuda to exit the graphical interface, there are basically two ways, you can select one of the following two commands :

sudo init 3

or

sudo service lightdm stop

But the results tell us naked, unsuccessful installation, download Ubuntu16.04 version of the installation package, install the driver fails under Ubuntu18.10

Therefore, very often still have to listen, to do according to official documents, look at the installation guide cuda9.0

https://developer.download.nvidia.com/compute/cuda/9.0/Prod/docs/sidebar/CUDA_Installation_Guide_Linux.pdf

Which states supported version of Ubuntu to Ubuntu 17.04 and Ubuntu 16.04, therefore, still a little honest, install it Ubuntu16.04

I downloaded a xubuntu-16.04.5-desktop-amd64.iso, install up, do you think this can it?

Definitely Definitely

Installation cuda still being given, like unable to locate kernel source, and why? Because the document said, supported kernel version 4.4, and kernel version xubuntu-16.04.5-desktop-amd64.iso of 4.15.0, does not meet the requirements

Therefore, very often still have to listen, how to reduce some say the Internet version of the kernel, since I think too much trouble, not now directly select the appropriate system version Well, anyway, I am not afraid to reinstall the system

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

Downloaded from the Internet xubuntu-16.04-desktop-amd64.iso or Xubuntu-Desktop-16.04.1-amd64.iso , maybe versions are 4.4 kernel, no problem, do not download later xubuntu-16.04.2 -desktop-amd64.iso, because the release of kernel version 4.8 is already a

Properly installed system, then install pip3, sudo apt install python3-pip, pip3 the installation, the system will automatically installed make, gcc these packages, by the way also solves the following installation depends cuda time

Download cuda (step above written), perform file cuda_9.0.176_384.81_linux.run installation, after the installation of the system will be prompted to write the file to the library path to /etc/ld.so.conf go, is added in the file line /usr/local/cuda-9.0/lib64,

Download and install cudnn, https://developer.nvidia.com/cudnn , click Download cuDNN, login, consent agreement, select Download cuDNN v7.4.1 (Nov 8, 2018 ), for CUDA 9.0, select cuDNN Runtime Library for Ubuntu16.04 (Deb), after downloading execute the command sudo dpkg -i libcudnn7_7.4.1.5-1 + cuda9.0_amd64.deb, you can install a good cudnn

Installation tensorflow-gpu, of course, you can use the command sudo pip3 install tensorflow-gpu, but will always report a warning, so if you do not like the warning, it is recommended to switch to the root account direct command pip3 install tensorflow-gpu, you can install a good

TensorFlow use the back is no longer explained, as long as the normal import tensorflow, installation should be no problem

Guess you like

Origin blog.csdn.net/zhqh100/article/details/84333703