check system info
uname -a
check which linux distribution
cat /etc/os-release
check cuda version
nvcc -- version
gpu info
nvidia-smi
gpu driver version
nvidia-settings --version or nvidia-smi

cuda install dir whereis cuda
/usr/local/cuda or /usr/local/cuda-9.0

if you use conda, you just need check your gpu driver version first:
cuda-compatibility
and conda install the suitable cudnn and cudatoolkit

path editting

source ~/.bashrc

conda

conda create -n theano python=2.7
conda activate theano
conda deactivate
show all env
conda info -e
install
conda install scikit-learn
conda install numpy=1.15
remove
conda remove --force numpy

test

$ python3
>>> import tensorflow as tf
>>> sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))