# 目前tensorflow2.2/2.3官方标配cuda10.1,也是官方在github给出方案,修改cuda软链接即可,非常简单。也不影响pytorch1.5(cuda10.2)的继续使用。
# 前提是你已经正确安装cuda10.2,检查:
nvcc -V
# 干正事(重点就这二步):
ln -s libcudart.so.10.2.89 libcudart.so.10.1
cd /usr/local/cuda-10.2/extras/CUPTI/lib64
ln -s libcupti.so.10.2.75 libcupti.so.10.1
# 检查添加路径:
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/extras/CUPTI/lib64
export PATH=${CUDA_HOME}/bin:${PATH}
# 检查GPU:
>>>import tensorflow as tf
>>>tf.__version__
2.2.0
>>>tf.test.is_gpu_available()
True
>>>tf.config.list_physical_devices('GPU')
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU'),
PhysicalDevice(name='/physical_device:GPU:1', device_type='GPU'),
PhysicalDevice(name='/physical_device:GPU:2', device_type='GPU'),
PhysicalDevice(name='/physical_device:GPU:3', device_type='GPU')]
大功告成!
watch -n 0.1 -d nvidia-smi #每隔0.1秒刷新一次
tailf log.txt
tensorboard --logdir=callbacks --host=xxx.xx.xxx.xx 服务器地址
摘录自https://blog.csdn.net/sinat_20174131/article/details/106807448