1.首先查看能调用的gpu的情况
python
import tensorflow as tf
tf.test.gpu_device_name()
2. 查看gpu的资源占用情况
nvidia-smi
3.使用fuser命令显示所有占用nvidia设备的进程processID。
sudo fuser /dev/nvidia*
4.杀死所有进程
killall -u 用户名
PS: 我的机器显示有一个GPU设备被ignore了
解决方法:
输入export TF_MIN_GPU_MULTIPROCESSOR_COUNT=5
Note though that the default is set for a reason – if you enable slower GPU by changing that variable, your program may run slower than it would without any GPU available, because TensorFlow will try to put run everything on that GPU.
1.首先查看能调用的gpu的情况
python
import tensorflow as tf
tf.test.gpu_device_name()
2. 查看gpu的资源占用情况
nvidia-smi
3.使用fuser命令显示所有占用nvidia设备的进程processID。
sudo fuser /dev/nvidia*
4.杀死所有进程
killall -u 用户名
PS: 我的机器显示有一个GPU设备被ignore了
解决方法:
输入export TF_MIN_GPU_MULTIPROCESSOR_COUNT=5
Note though that the default is set for a reason – if you enable slower GPU by changing that variable, your program may run slower than it would without any GPU available, because TensorFlow will try to put run everything on that GPU.