Skip to content

Instantly share code, notes, and snippets.

@yugeshsivakumar
Created December 8, 2024 21:24
Show Gist options
  • Save yugeshsivakumar/7b7a0efda8ee177dc1dd6dc437d9128b to your computer and use it in GitHub Desktop.
Save yugeshsivakumar/7b7a0efda8ee177dc1dd6dc437d9128b to your computer and use it in GitHub Desktop.
Nvidia Cudatoolkit vs Conda Cudatoolkit in tensorflow

For install cudatoolkit and cudnn by Anaconda you can use these following command conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0 on command prompt

You must aware the tensorflow version must be less than 2.11 for above command

Please check the following website and choose the appropriate versions for TensorFlow, TensorFlow-GPU, CUDA, and cuDNN:

https://www.tensorflow.org/install/source_windows#gpu

https://www.tensorflow.org/install/source_windows#cpu

For check if the everything installed properly

  1. In command prompt check nvidia-smi command. if shows command not found you must install the latest GPU driver

  2. Use this python script which give given as GPU_test.py to detect gpu by python

import tensorflow as tf
if tf.config.list_physical_devices('GPU'):
print('GPU is available.')
else:
print('GPU is NOT available. Make sure TensorFlow version less than 2.11 and Installed all GPU drivers.')
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.compat.v1.Session(config=config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment