Install issues on Windows with VS Code

I’ve been using Python 3.10 with TensorFlow 2.10 with Visual Studio Code and was relatively happy with my experience. Unfortunately, I had some unrelated issues and reformatted. I am now running Windows 11 and have been unable to get Tensorflow to work with my GPU.

I’ve tried python3 -m pip install “tensorflow<2.11” which installs but gives:

(env1) C:\Windows\System32>python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
2023-01-01 18:45:07.007047: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2023-01-01 18:45:07.007203: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
C:\Users\bvbel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\numpy\_distributor_init.py:30: UserWarning: loaded more than 1 DLL from .libs:
C:\Users\bvbel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\numpy\.libs\libopenblas.FB5AE2TYXYH2IJRDKGDGQ3XBKLKTF43H.gfortran-win_amd64.dll
C:\Users\bvbel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\numpy\.libs\libopenblas64__v0.3.21-gcc_10_3_0.dll
  warnings.warn("loaded more than 1 DLL from .libs:"
2023-01-01 18:45:08.115853: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2023-01-01 18:45:08.116121: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublas64_11.dll'; dlerror: cublas64_11.dll not found
2023-01-01 18:45:08.116550: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll not found
2023-01-01 18:45:08.116784: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2023-01-01 18:45:08.119277: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
2023-01-01 18:45:08.119569: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusolver64_11.dll'; dlerror: cusolver64_11.dll not found
2023-01-01 18:45:08.120101: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found
2023-01-01 18:45:08.120364: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
2023-01-01 18:45:08.120760: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1934] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
[]

This happens with both cuda_11.2.0_460.89_win10 and cuda_11.3.0_465.89_win10. I have verified cudart64_110.dll is in the correct directory and that this directory is in the PATH.

I have tried newer versions of both tensorflow and cuda with wsl and have even had it recognize my GPU from a Unbuntu command prompt. However I was unsuccessful getting visual studio code to point at the Linux instance.

I’d really appreciate some help. I just want to get my PC back to the way it was, I don’t are which version I am on - although I really don’t want to reformat again to go back to Windows 10, especially if that doesn’t help.

  1. Haven’t had experience with TF running on Windows 11 but have you checked these third-party (unverified) tutorials made by the TF community:

and

  1. Are you trying to run TF 2.x on WSL2? (Install TensorFlow with pip)

I’ve seen those (and many other videos). There are a lot of videos, a lot of different versions, and a lot of different ways to install each version. I’ve tried both with and without WSL2.

The first video you posted is the simplest, unfortunately doesn’t work with the latest version, and gives me the ‘cudart64_110.dll’ error I posted. I have no idea why it worked for him and not for me.

The approach in the 2nd video got me a working GPU, but I couldn’t figure out how to use it in VSCode (or anywhere outside of my WSL command line). The author of the 2nd video has more videos using Docker, which I don’t really have time to learn, but might be useful otherwise and might be the best way to run this.

Hopefully someone will post something that lets me do this the simple way in the first video. If not, I will eventually get time to learn docker or to learn a different ML framework.

Since this may be Windows 11-related, cross-posting this from another topic:

http://discuss.ai.google.dev/t/cant-see-the-gpu-on-a-laptop-ubuntu-under-wsl/13964/6?u=8bitmp3

Also, since you’re using VS Code, have you seen this:

Good luck!

By the way, how was the experience running TensorFlow 2.10 with VS Code on Windows 11?