Last active
August 29, 2022 18:14
-
-
Save ggmartins/bf55c0fc6f98fdeca88ddeabd04cfab5 to your computer and use it in GitHub Desktop.
tensorflow gpu check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import tensorflow as tf | |
print(tf.__version__) | |
if tf.test.gpu_device_name(): | |
print('Default GPU Device:{}'.format(tf.test.gpu_device_name())) | |
else: | |
print("Please install GPU version of TF") |
for tf2.4.1,
export LD_LIBRARY_PATH=/usr/local/cuda-11.3/targets/x86_64-linux/lib/:/usr/local/cuda-10.2/targets/x86_64-linux/lib/
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cuda_version=10.2
export CUDA_HOME=/usr/local/cuda-${cuda_version}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64