Tensorflow如何配置和使用GPU
tf.GPUOptions()
gpu_options = tf.GPUOptions(allow_growth=True)
gpu_options =tf.GPUOptions(per_process_gpu_memory_fraction=0.8,allow_growth=True) ##每个gpu占用0.8 的显存
config=tf.ConfigProto(gpu_options=gpu_options,allow_soft_placement=True)
sess=tf.session(config=config)##如果电脑有多个GPU,tensorflow默认全部使用。如果想只使用部分GPU,可以设置CUDA_VISIBLE_DEVICES。
控制使用哪个gpu
一、Nividia系列
Tesla M40
Tesla P100
Tesla T4
Tesla V100
二、CUDA
三、CUDA-tensorflow版本
四、如何查看系统有几个GPU
五、nvidia-smi命令
nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64.00 Driver Version: 440.64.00 CUDA Version: 10