I just installed TensorFlow using pip, and I have an NVIDIA RTX 3060, but when I run my training script, it's only utilizing my CPU. I checked tf.config.list_physical_devices('GPU') and it returns an empty list. I've installed the latest drivers, so what am I missing? Is there a specific version of CUDA or cuDNN that I need to be compatible with TensorFlow 2.10+ on Windows?
3 answers
Native Windows GPU support stopped at TF 2.10. For newer versions, you really need to set up WSL2. It's much faster and avoids most of the library version conflicts.
For native Windows, TensorFlow dropped GPU support after version 2.10. If you are using a newer version, you must use WSL2 (Windows Subsystem for Linux) to access your GPU. Alternatively, if you must stay on native Windows, you need to install TensorFlow 2.10 specifically along with CUDA 11.2 and cuDNN 8.1. Check your environment variables to ensure the CUDA 'bin' and 'libnvvp' folders are in your Path. Most users find migrating to WSL2 much easier as it aligns better with the current TF development roadmap.
Did you check if your Python environment is seeing the DLL files correctly, or have you considered moving your entire development stack over to a Docker container?
Kevin, Docker is great, but for a Windows user, WSL2 is the native way to get that done now. If Thomas checks the NVIDIA documentation, they have a specific driver called the 'Game Ready' or 'Studio' driver that includes the WSL-GPU hooks. Once that's installed in Windows, he just needs to install the NVIDIA Container Toolkit inside his Ubuntu WSL instance to bridge the hardware gap for TensorFlow.
Agreed, Laura. I spent days trying to fix DLL errors on Windows before switching to WSL2. Now my RTX card works perfectly with the latest TensorFlow 2.15.