From the link https://www.tensorflow.org/install/source#linux, for tensorflow-2.0.0, it requires cuDNN version 7.4 and CUDA 10.0. Not sure what your cuDNN version is (you can check it with:
cat ${CUDNN_H_PATH} | grep CUDNN_MAJOR -A 2
and it should return:
#define CUDNN_MAJOR 7
#define CUDNN_MINOR 5
#define CUDNN_PATCHLEVEL 0
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
=> this means its 7.5.0
I've read that if the link above specifies 7.4, you can't use any other version (not even 7.5, 7.6 etc). So look for the archived versions on cuDNN downloads.
I suggest you uninstall all your nvidia drivers, tensorflow-gpu, cuDNN, all cuda libraries and toolkits in your /usr/local folder and do a fresh install. Don't install both tensorflow and tensorflow-gpu. Just install the tensorflow-gpu one.
Here's how to uninstall nvidia-cuda-toolkit and its dependencies:
sudo apt-get remove --auto-remove nvidia-cuda-toolkit
Remember to edit your ~/.bash_profile file
After everything is properly uninstalled and purged, install nvidia-driver-418 (I personally use this version, but according to the nvidia docs, for CUDA 10 as long as its 410.xx its okay - nvidia docs tensorflow release notes):
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-driver-418
Then reboot and check with nvidia-smi command that it says:
NVIDIA-SMI 430.50 Driver Version 430.50
Then download and install CUDA 10.0
Please don't download any other versions (not 10.1, 10.2, etc - sorry for being naggy)
just remember to select n (no) for installing NVIDIA Accelerated Graphics Driver. There will be an error message saying its incomplete installation but you can ignore it.
make sure ~/.bashrc file includes cuda-10.0
export PATH=/usr/local/cuda-10.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64
Then download cuDNN v7.4.2 for CUDA 10.0. After extracting the tgz file with tar command, cd into the cuda folder and copy the contents of the lib64/ directory and all its contents into the /usr/local/cuda/lib64/ path. Also, copy the include/ folder into the /usr/local/cuda/include/ path like so:
sudo cp -P lib64/* /usr/local/cuda/lib64/
sudo cp -P include/* /usr/local/cuda/include/
Check with
tf.test.is_gpu_available()
and it should return True.