1

我已经为带有 Tesla k80 GPU 的 TensorFlow 运行了卷积神经网络的示例代码。

https://www.tensorflow.org/versions/r0.9/tutorials/deep_cnn/index.html#launching-and-training-the-model-on-multiple-gpu-cards

$ python cifar10_multi_gpu_train.py --batch_size 64 --num_gpus 2

Then I've checked a memory usage of GPU's. The result is below.

$ nvidia-smi 
Mon Oct 31 16:34:15 2016       
+------------------------------------------------------+                       
| NVIDIA-SMI 352.93     Driver Version: 352.93         |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro K420         Off  | 0000:01:00.0      On |                  N/A |
| 25%   45C    P0    N/A /  N/A |    264MiB /  1023MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  Tesla K80           Off  | 0000:04:00.0     Off |                    0 |
| N/A   41C    P0    66W / 149W |  11022MiB / 11519MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   2  Tesla K80           Off  | 0000:05:00.0     Off |                    0 |
| N/A   37C    P0    67W / 149W |    130MiB / 11519MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0      8757    C   python                                           8MiB |
|    0     13398    G   /usr/bin/Xorg                                   92MiB |
|    0     14355    G   /usr/bin/gnome-shell                           146MiB |
|    1      8757    C   python                                       10956MiB |
|    2      8757    C   python                                          64MiB |
+-----------------------------------------------------------------------------+

“GPU 1”的内存使用量为 11Gb,约为 12Gb 最大值的 95%。但是“GPU 2”的内存使用量只有 64Mb。你能告诉我如何在 Tesla K80 上使用 GPU 的内存和 TensorFlow 吗?

4

0 回答 0