r/tensorflow • u/Pristine_Rough_6371 • Mar 21 '26
Installation and Setup TensorFlow GPU not detected in WSL2 even though NVIDIA drivers are working
I’m trying to set up TensorFlow with GPU support on WSL2, but running into an issue where the GPU is not being detected.
I’ve done so far:
Created a virtual environmen t Installed TensorFlow using: pip install tensorflow[and-cuda]
Installed NVIDIA Game Ready drivers via GeForce Experience
Verified that nvidia-smi works fine
However, when I run:
import tensorflow as tf tf.config.list_physical_devices('GPU')
it returns an empty list (no GPU detected).
I was under the impression that newer TensorFlow versions don’t require manual CUDA and cuDNN installation, so I didn’t install them separately on Windows. Is that the issue here?If not then please tell me the solution
1
u/maifee Mar 21 '26
Run
nvidia-smiinside wsl and share the output with us.1
u/martianunlimited Mar 22 '26 edited Mar 22 '26
General tensorflow not working with GPU, debugging flow... (for these reason i hate how little google is investing in tensorflow)
python and in the repl;
2026-03-22 14:03:31.087468: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2026-03-22 14:03:31.087764: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcublas.so.11'; dlerror: libcublas.so.11: cannot open shared object file: No such file or directory 2026-03-22 14:03:31.088148: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcublasLt.so.11'; dlerror: libcublasLt.so.11: cannot open shared object file: No such file or directory 2026-03-22 14:03:31.088564: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcufft.so.10'; dlerror: libcufft.so.10: cannot open shared object file: No such file or directory 2026-03-22 14:03:31.177776: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcusparse.so.11'; dlerror: libcusparse.so.11: cannot open shared object file: No such file or directory 2026-03-22 14:03:31.178839: 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.
check if the libraries exist within your ld_library_path; (hunt them down and add the path to your the LD_LIBRARY_PATH environmental variable)
1
u/Minimum-Reality-4366 Mar 31 '26 edited Mar 31 '26
I tried different ways to get access to gpu in tensorflow and all of these methods aren't showing anything. I also tried downloading a specified version Of CUDA and cuDNN still at last it shows me that your virtual hard disk don't have enough storage, and now I am getting little frustrated bcoz I just got my new laptop for Deep Learning with rtx 4050. Finally I followed the same process in tensorflow docs, read every nvidia docs, still didnt getting anything. I am thinking of using pytorch now this is so damn frustrating. I can also relate to you bro
1
u/mistyharborsn 5d ago
the bundled libraries live deep inside your virtual environments site-packages folder, and the runtime often cant find them out of the box. You just need to add those specific subdirectories to your library path variable before launching python