'Cuda Cudnn installation failed to run GPU

I have pyhton 3.8.8 V I installed tha latest version of Cuda & Cudnn:

  • Cuda: 11.6.1_511.65
  • Cudnn: windows-x86_64-8.3.2.44

Installation completed successfully

I check to validate if installed correctly:

nvidia-smi

NVIDIA-SMI 511.65 Driver Version: 511.65 CUDA Version: 11.6

nvcc -V

Cuda compilation tools, release 11.6, V11.6.112

On spyder I run the following:

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

with the output:

incarnation: 12146292582786704115
xla_global_id: -1
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 4185718784
locality {
  bus_id: 1
  links {
  }
}

So I should get the GPU running, no?

when I check to see if it is running I get:

import pytorch as T
device = T.device('cuba:0' if T.cuda.is_available() else 'cpu')
device
device(type='cpu')

This mean that I'm working on the cpu.

Can someone please tell if it is the right configuration to install

If not, please share it (-:

Thanks,

Guy



Solution 1:[1]

Thanks for all the answers and comments

I installed the correct version of torch on a clean env and its working great

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

Now I get:

T.cuda.is_available()
Out[3]: True

Solution 2:[2]

I use specify configuration on loading ... ( It specify methods when you running on high load but pre-processing data help a lot this machine is since study time )

Input:

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
None
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
physical_devices = tf.config.experimental.list_physical_devices('GPU')
assert len(physical_devices) > 0, "Not enough GPU hardware devices available"
config = tf.config.experimental.set_memory_growth(physical_devices[0], True)
print(physical_devices)
print(config)

Output:

[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
None

Client configuration:

F:\temp\Python>python
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow.python.client import device_lib
>>> print(device_lib.list_local_devices())
2022-03-08 15:43:42.432423: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-03-08 15:43:43.079791: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /device:GPU:0 with 4634 MB memory:  -> device: 0, name: NVIDIA GeForce GTX 1060 6GB, pci bus id: 0000:01:00.0, compute capability: 6.1
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 4332681191941868454
xla_global_id: -1
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 4859428864
locality {
  bus_id: 1
  links {
  }
}
incarnation: 14686361706815839987
physical_device_desc: "device: 0, name: NVIDIA GeForce GTX 1060 6GB, pci bus id: 0000:01:00.0, compute capability: 6.1"
xla_global_id: 416903419
]
>>>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user14807698
Solution 2 Martijn Pieters