guys!
I have a pretty common issue: tensorflow framework can’t recognize available GPUs on my laptop.
When i try to list available GPUs in VS Code using Python (v3.11.0):
<code>import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
print("Built with CUDA:", tf.test.is_built_with_cuda())
print("Built with GPU device support:", tf.test.is_built_with_gpu_support())
output:
Num GPUs Available: 0
Built with CUDA: False
Built with GPU device support: False
</code>
<code>import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
print("Built with CUDA:", tf.test.is_built_with_cuda())
print("Built with GPU device support:", tf.test.is_built_with_gpu_support())
output:
Num GPUs Available: 0
Built with CUDA: False
Built with GPU device support: False
</code>
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
print("Built with CUDA:", tf.test.is_built_with_cuda())
print("Built with GPU device support:", tf.test.is_built_with_gpu_support())
output:
Num GPUs Available: 0
Built with CUDA: False
Built with GPU device support: False
Laptop specs:
- System: Windows 11 Pro (23H2)
- GPU: GeForce GTX 1660Ti 6Gb
- CPU: Intel Core i7 9750h
What i’ve done before:
- Download Tensorflow framework (2.16.1) via pip
<code>pip install tensorflow[and-cuda]
</code>
<code>pip install tensorflow[and-cuda]
</code>
pip install tensorflow[and-cuda]
- Updated NVIDIA driver (v560.70)
- Downloaded NVIDIA GPU Computing Toolkit (CUDA v12.3)
- Downloaded cuDNN driver (v8.9) and paste files from bin, lib, include to appropriate folders in CUDA root path
- Manually added environment variables in Windows system properties (Path, CUDA_PATH, CUDA_HOME)
Env variables config - Added custom graphic settings to VS Code IDE Settings -> System -> Display -> Graphics
- Checked: does the system detect the video card using cmd: nvidia-smi terminal output
- Checked drivers compatibility (i guess everything ok)
- Restart system
Hope we’ll find the solution :), if you have specific questions, please ask
New contributor
Vladimir Hartoniuk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.