This was asked here How to solve Conv1D DNN library is not found? but the answer does not solve my problem. I am using cuda toolkit 11.2 and cudnn 8.1, but I still get this error.
Running in vscode, using a fresh tf environment. The library load path appears to include cudnn
LD_LIBRARY_PATH=/home/amw/anaconda3/envs/tf/lib/:/home/amw/anaconda3/envs/tf/lib/python3.9/site-packages/nvidia/cudnn/lib:/home/amw/anaconda3/lib/:/home/amw/anaconda3/envs/tf/lib/python3.9/site-packages/nvidia/cudnn/lib::/home/amw/anaconda3/envs/tf/lib/:/home/amw/anaconda3/envs/tf/lib/python3.9/site-packages/nvidia/cudnn/lib:/home/amw/anaconda3/envs/tf/lib/
I tried setting CUDA_HOME to CONDA_PREFIX, and that did not solve the problem.
I remember finding a procedure for installing tensorflow that included instructions for setting the cuda path, but I cannot find it.
Any help will be appreciated.
Addition: I also tried setting CUDNN_PATH to $CONDA_PREFIX, and also to $CONDA_PREFIX/lib , but this did not work.
Additional info: OS: POP OS (ubuntu 22.04)
conda version 23.1.0
relevant env info:
LD_LIBRARY_PATH=/home/amw/anaconda3/envs/mia_envNew/lib/:/home/amw/anaconda3/envs/tf/lib:/home/amw/anaconda3/envs/tf/lib/:/home/amw/anaconda3/envs/tf/lib:/home/amw/anaconda3/envs/tf/lib/:/home/amw/anaconda3/envs/tf/lib:/home/amw/anaconda3/envs/tf/lib/:/home/amw/anaconda3/envs/tf/lib:/home/amw/anaconda3/envs/tf/lib/:/lib:/home/amw/anaconda3/envs/tf/lib/:/lib::/home/amw/anaconda3/envs/tf/lib/:/home/amw/anaconda3/envs/tf/lib/:/home/amw/anaconda3/envs/tf/lib/
CUDA_HOME=/home/amw/anaconda3/envs/tf
PATH=/home/amw/anaconda3/envs/tf/bin:/home/amw/anaconda3/condabin:/home/amw/.local/bin:/home/amw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
CONDA_PREFIX_1=/home/amw/anaconda3
CONDA_PREFIX_2=/home/amw/anaconda3/envs/tf
CONDA_PREFIX_3=/home/amw/anaconda3
Update: I reinstalled cudnn and cuda_toolkit with mamba install cudatoolkit cudnn
This appeared to solve the problem, until I rebooted. Then the problem returned. I set the env variable, and cannot see what has changed.
Update: it stopped working again (I do not know why) and even reinstalling tensorflow, cuda etc it still does not work.
print("Num GPUs Available: ",len(tf.config.list_physical_devices('GPU')))
outputs:
Num GPUs Available: 1
but when I write python code in spyder, vscode, or jupyter, I still get
DNN library is not found
.