Tensorflow2.X-GPU-CUDA9.0
Tensorflow2.X-GPU-CUDA9.0 copied to clipboard
Tensorflow2.0-GPU-CUDA9.0
Tensorflow2.X-GPU-CUDA9.0
Tensorflow2.X-GPU-CUDA9.0
This Tensorflow2.X-GPU-CUDA9.0 is bazeled from the sorce code of Google.
Install
If you have configured cuda9 and cudnn in your .bashrc, you can skip to Third step.
First
Create cuda9.0 environment by conda
conda create -n cuda9.0
conda activate cuda9.0
conda install cudatoolkit=9.0 cudnn=7.6.0 cupti
Second
Add dependency in .bashrc
Use conda env list find the path of cuda9.0
conda env list
(tf2) wxy@sait:~$ conda info -e
# conda environments:
#
cuda9.0 /disk1/lx/conda/envs/cuda9.0
mk /disk1/lx/conda/envs/mk
change the CONDA_ENV to your path of cuda9.0
add the following three lines of code in .bashrc
vim ~/.bashrc
export CONDA_ENV="/disk1/lx/conda/envs/cuda9.0"
export CUDA_HOME="$CUDA_HOME:$CONDA_ENV/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CONDA_ENV/lib"
Then source .bashrc
in you terminal.
source ~/.bashrc
Third
Download and unzip the .whl file
Google-drive: tensorflow2.1-gpu-cudn9.0-py3.7
Google-drive: tensorflow2.0-gpu-cudn9.0-py3.7
Google-drive: tensorflow2.0-gpu-cudn9.0-py3.6
Google-drive: tensorflow2.0-gpu-cudn9.0-py3.5
Create a new env in conda(you can change test to your like)
conda create -n test python=3.7
conda activate test
pip install tensorflow-2.0.0-cp37-cp37m-linux_x86_64.whl
Test
python
import tensorflow as tf
tf.test.is_gpu_available()
If it shows True, congratulations.
Error
W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusolver.so.9.0';.....undefined symbol: GOMP_critical_end;
If you have this error, please add follow code in your code.
import tensorflow as tf
import ctypes
ctypes.CDLL("libgomp.so.1", mode=ctypes.RTLD_GLOBAL)
tf.test.is_gpu_available()
If it works , please give me a star.
Thank you!
How to install tensorflow2.X-GPU in your cuda version?
you need to bazel from the source code of tensorflow in your machine.
Reference