- Windows tensorflow compatibility. Linux tensorflow compatibility
- Install NVIDIA GPU Driver: Ensure you have the latest NVIDIA GPU driver installed.
- Install CUDA Toolkit: Download and install the CUDA Toolkit from the NVIDIA website.
- Install cuDNN: Download and install cuDNN from the NVIDIA website.
- In order for CUDA toolkit to work, we must also install Visual Studio with
Desktop development with C++
. See guideline here
Install TensorFlow with GPU support using pip:
pip install tensorflow-gpu
You can verify that TensorFlow is using the GPU by running the following code:
import tensorflow as tf
# Check if TensorFlow is built with GPU support
print("Built with GPU support:", tf.test.is_built_with_cuda())
# List available devices
print("Available devices:")
for device in tf.config.list_physical_devices():
print(device)
# Check if a GPU is available
print("GPU available:", tf.test.is_gpu_available())