Difference between revisions of "Installing TensorFlow"

From edegan.com
Jump to navigation Jump to search
Line 45: Line 45:
 
  nvcc -V
 
  nvcc -V
 
[[File:nvcc.png]]
 
[[File:nvcc.png]]
 +
 +
*5. Downloaded cuDNN:
 +
In order to download cuDNN, ensure you are registered for the NVIDIA Developer Program. Then Go to: NVIDIA cuDNN home page. -> Click Download. -> Complete the short survey and click Submit. -> Accept the Terms and Conditions. A list of available download versions of cuDNN displays. -> Select the cuDNN version you want to install. Chose the tar file.
 +
*6. Install cuDNN: your CUDA directory path is referred to as
 +
/usr/local/cuda/
 +
your cuDNN download path is referred to as
 +
<cudnnpath>
 +
Follow these commands:
 +
a. Navigate to your <cudnnpath> directory containing the cuDNN Tar file.
 +
b. Unzip the cuDNN package.
 +
$ tar -xzvf cudnn-9.0-linux-x64-v7.tgz
 +
c. Copy the following files into the CUDA Toolkit directory.
 +
$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
 +
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
 +
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h
 +
/usr/local/cuda/lib64/libcudnn*
 +
  
 
*'''Problem encountered''':
 
*'''Problem encountered''':
Line 52: Line 69:
 
3. <s>If installed correctly, type nvcc- V should verify installation. But currently it returns 'the program nvcc is currently not installed'.</s><br>
 
3. <s>If installed correctly, type nvcc- V should verify installation. But currently it returns 'the program nvcc is currently not installed'.</s><br>
  
==Tensorflow Installation==
+
==Tensorflow Installation Resource==
*(TODO) To install tensorflow, follow this instruction here: https://www.tensorflow.org/install/install_linux#InstallingVirtualenv and install tensorflow with Wei. Specific is below.
+
*(TODO) To install tensorflow, follow this instruction here: https://www.tensorflow.org/install/install_linux#InstallingVirtualenv and install tensorflow.

Revision as of 17:58, 12 July 2018

Old

Currently installed with Anaconda Python 3.

https://stackoverflow.com/questions/36355073/upgrading-numpy-fails-with-permission-denied-error

https://www.tensorflow.org/install/install_windows

with cpu support only

https://www.tensorflow.org/install/install_linux

need to logoff other users via server manager

https://stackoverflow.com/questions/46499808/pip-throws-typeerror-parse-got-an-unexpected-keyword-argument-transport-enco#_=_

New (by Wei and Minh)

Important note: install the version of software/packages strictly according to the instructions provided by Tensorflow. A different version of software, for example CUDA toolkit 9.2 instead of 9.0, might lead to failure in tensorflow.

NVIDIA configuration

(In progress) Before installing tensorflow with GPU, configure the NVIDIA® software by following instruction: https://www.tensorflow.org/install/install_linux#NVIDIARequirements

Install CUDA Toolkit 9.0

  • 1. Installed CUDA Toolkit 9.0 Base Installer with the Runfile option. The toolkit is in
/usr/local/cuda-9.0 

for the toolkit. Did NOT install NVDIA accelerated Graphics Driver for Linux-x86_64 384.81 (We believe we have a different graphic driver. we have a much Newer version(396.26)). Installed the CUDA 9.0 samples in

HOME/MCNAIR/CUDA-SAMPLES.
  • 2. Installed Patch 1, 2 and 3. The command to install was
sudo sh cuda_9.0.176.2_linux.run # (9.0.176.1 for patch 1 and 9.0.176.3 for patch 3)
  • 3. Set up the environment variables:

The PATH variable needs to include /usr/local/cuda-9.0/bin To add this path to the PATH variable:

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

In addition, when using the runfile installation method, the LD_LIBRARY_PATH variable needs to contain /usr/local/cuda-9.0/lib64 on a 64-bit system To change the environment variables for 64-bit operating systems:

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

Note that the above paths change when using a custom install path with the runfile installation method.
To accomplish this:

nano /home/mcnair/.bashrc

Add

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}}

Save and exit. Close and open the terminal (or source .bashrc).

  • 4. To verify CUDA Toolkit 9.0 is installed, type
nvcc -V

Nvcc.png

  • 5. Downloaded cuDNN:

In order to download cuDNN, ensure you are registered for the NVIDIA Developer Program. Then Go to: NVIDIA cuDNN home page. -> Click Download. -> Complete the short survey and click Submit. -> Accept the Terms and Conditions. A list of available download versions of cuDNN displays. -> Select the cuDNN version you want to install. Chose the tar file.

  • 6. Install cuDNN: your CUDA directory path is referred to as
/usr/local/cuda/

your cuDNN download path is referred to as

<cudnnpath>

Follow these commands: a. Navigate to your <cudnnpath> directory containing the cuDNN Tar file. b. Unzip the cuDNN package.

$ tar -xzvf cudnn-9.0-linux-x64-v7.tgz

c. Copy the following files into the CUDA Toolkit directory.

$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h
/usr/local/cuda/lib64/libcudnn*


  • Problem encountered:

1. In usr/local/ we found files 'CUDA-9.2' and 'CUDA-8.0'. These were probably installed in the past.
2. When execute the following command in a terminal, it returns 'PATH: command not found'.

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

3. If installed correctly, type nvcc- V should verify installation. But currently it returns 'the program nvcc is currently not installed'.

Tensorflow Installation Resource