April 19, 2023, 12:19pm
I now lost 3 days of my valuable life trying to get tensorflow to detect and use my GPU to train some neuronal network models and I desperately need help.
I tried uncountable tutorials and forum posts but nothing did work.
I have a MSI GTX 1070 (latest driver)
Windows 10 Pro 64bit
CUDA 11.8.0 (I checked the tf homepage if my versions are compatible, and they should be)
ソースからビルド | TensorFlow sais:
tensorflow-2.12.0 python 3.8-3.11 GCC 9.3.1 Bazel 5.3.0 CuDNN 8.6 CUDA 11.8
and I set my system environment variables like I should (adding CUDA and CuDNN paths to “Path”)
I tried seing my GPU with “print(tf.config.list_physical_devices(‘GPU’))” in VSC and Anaconda Prompt and both returned nothing
Restarting the PC uncountable times didn’t change anything.
I’m really desperate, please help me.
Thanks in advance
April 19, 2023, 2:54pm
About a year ago I used CUDA in combination with Matlab and it worked just fine, so I know at least that my 1070 is able to work with CUDA.
@Marius, TensorFlow 2.10 was the last TensorFlow release that supported GPU on native-Windows. Starting with TensorFlow 2.11
, you will need to install TensorFlow in WSL2, or install tensorflow-cpu` and, optionally, try the TensorFlow-DirectML-Plugin. For installing WSL2 please refer to this
document. Thank You.
April 19, 2023, 9:29pm
thanks a lot for your response!
Is it possible to uninstall my version of tf and just install tf 2.10? (And the compatible versions of cuda und cudnn to harmonize with tf 2.10)
@Marius , Yes it is possible to uninstall tensorflow by using pip unistalll tensorflow and you can install 2.10 version. Thank You.
April 20, 2023, 12:39pm
thanks you very much for your help!
I now run following configuration:
Python 3.10.11, TF 2.10.0, CuDNN 22.214.171.124, CUDA 11.2.0
Tensorflow now does find my GPU:
print("Num GPUs Available: ", len(tf.config.list_physical_devices(‘GPU’)))
Num GPUs Available: 1
from tensorflow.python.client import device_lib
, name: “/device:GPU:0”
physical_device_desc: “device: 0, name: NVIDIA GeForce GTX 1070, pci bus id: 0000:01:00.0, compute capability: 6.1”
Do you have any advice/tips on how to find out wether VSC is now really using my GPU or not? To verify wether it just knows that the GPU is there or it’s actually using it? And is it possible to turn it off or on to use the gpu?
Thanks a lot again!
@Marius, As len(tf.config.list_physical_devices(‘GPU’)) display output as 1, i.e 1 GPU was detected by the tensorflow. Thank You.