how to use GTX 1660 supper GPU in tensorflow? - python-3.x

Edit:
it worked when I reinstall tensorflow.
I have GTX 1660 supper GPU and I installed the latest version of CUDA, cuDNN and the Driver.
when I import tensorflow as tf I get this message.
2021-05-18 12:19:45.541654: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
but when I print(tf.config.list_physical_devices('GPU'))
the output is empty[]

From comments
I have reinstalled tensorflow when I Installed CUDA and cuDNN then
it's worked. (paraphrased from Osama Adel)

Related

RuntimeError: cuDNN version incompatibility

I wrote an LSTM NLP classifier with PyTorch, in google colab and it worked well. Now, I run it on google colab pro, but I get this error:
RuntimeError: cuDNN version incompatibility: PyTorch was compiled against (8, 3, 2) but found runtime version (8, 0, 5). PyTorch already comes bundled with cuDNN. One option to resolving this error is to ensure PyTorch can find the bundled cuDNN.one possibility is that there is a conflicting cuDNN in LD_LIBRARY_PATH.
I have no idea how to fix this. I'm using GPU on colab pro.
I've tried this link and it didn't work.
How I declared device:
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
Fixed via upgrading cuDNN to 8.4
reference (https://github.com/JaidedAI/EasyOCR/issues/716)
if you are using google colab uae this command
!pip install --upgrade torch torchvision

Problems getting GPU to work with older version of Tensorflow and Keras

I have a project I'm trying to work on but it's based on code that's a few years old and for whatever reason this code tends to fail if Tensorflow or NumPy aren't the correct versions (which means everything I'm using has to be old). This has meant that I've needed to dual-install an older version of Python to then be able to install the correct versions of the dependencies.
I'm running:
Python 3.7.5
NumPy 1.17.4
Pandas 0.25.3
pyyaml 5.1.2
more_itertools 7.2.0
keras 2.3.1
tensorflow 2.0.1
CUDA 10.0
CuDNN 7.4.1
I'm particularly interested in the keras and tensorflow versions. From my research, it seems they should work with GPU (as is?) according to this:
https://www.tensorflow.org/install/source (towards the bottom under tested build configurations for GPU).
However, when I try to detect GPU devices on my build with
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
I get
2022-03-22 19:34:53.410102: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 1722158755601489749
]
Which seems like it isn't recognising my GPU.
Is there something I'm missing in the setup process that I need to enable GPU support? As far as I can tell my versions of Tensorflow and Keras are compatible with GPU processing and have compatible versions of CUDA and CuDNN installed.

Why doesn't torch see сuda?

i have problem with torch and cuda.
torch.version.__version__ gives "1.5.1+cu101"
torch.version.cuda gives "10.1"
torch.backends.cudnn.version() gives "7603"
But torch.cuda.is_avaliable() gives False. What can be wrong?
Parameters of my system:
Linux-x86_64 (Ubuntu 20.04)
GeForce GTX 1050
NVIDIA Driver Version: 460.67

RuntimeError: CuDNN error: CUDNN_STATUS_SUCCESS

I am running code that UI downloaded from github. It is supposed to be working (I saw that other people managed to activate it). When I try to run it I get the following error message:
RuntimeError: CuDNN error: CUDNN_STATUS_SUCCESS
The code uses pytorch 0.4.1. I have cuda installed.
When I run the command cat /usr/local/cuda/version.txt
I get the answer:
CUDA Version 10.0.130
When I run the command conda list -n <my env name>
I see:
cudatoolkit ver 9.0
cudnn ver 7.6.5
And now, my question:
What should I do to avoid this error?
Do I need to use pip install for a more recent version of cudnn? If so, which one?
I also faced the same issue. In my case, the PyTorch version was 0.4.1, and the Cuda version was 9.0. I solved the issue by adding this piece of code:
torch.backends.cudnn.benchmark = True
try this
if torch.cuda.is_available():
device = torch.device("cuda")
print("working on gpu")
else:
device = torch.device("cpu")
print("working on cpu")

Theano 0.10: Can not use cuDNN on context None: cannot compile with cuDNN

I just updated theano to 0.10 version with pip:
pip install --no-deps git+https://github.com/Theano/Theano.git#egg=Theano
But it cannot be imported successfully, with the error message as follows:
Can not use cuDNN on context None: cannot compile with cuDNN.
We got this error: c:\users\yl~1\appdata\local\temp\try_flags_jbgv_m.c:4:19:  
fatal error: cudnn.h: No such file or directory compilation terminated.   
Mapped name None to device cuda: GeForce 940M (0000:01:00.0)
I haven't configured theano to use cudnn. I feel theano should works without it.
My .theanorc is:
Without the .theanorc file, theano works fine.
I have also posted this issue at:
https://github.com/Theano/Theano/issues/6063#issuecomment-310064365
The best solution I have is to bypass cudnn by add in the .theanorc:
[dnn]
enabled = False
but at the price of the decreased computation speed

Resources