【问题标题】:Why do TensorFlow programs that use the GPU have a much higher virtual size than TensorFlow programs running on CPU only?为什么使用 GPU 的 TensorFlow 程序的虚拟大小比仅在 CPU 上运行的 TensorFlow 程序大得多?
【发布时间】:2017-07-16 16:35:49
【问题描述】:

在我的 Ubuntu 14.04.5 LTS x64 服务器上,我有 3 个在 GPU 上运行的 TensorFlow 程序和 2 个在 CPU 上运行的 TensorFlow 程序:

 CPU%   MEM%  VIRT   RES   PID USER        NI S     TIME+   R/s   W/s Command
1047.3   0.1 11.7G 1.04G 29414 userli       0 S  34h06:03     0     0 python3.5 main_CPU.py
 930.6   0.1 12.2G  996M 28443 userli       0 R  44h58:36     0     0 python3.5 main_CPU.py
 162.0   0.1  776G 1.33G 27457 userli       0 S   8h09:06     0     0 python3.5 main_GPU.py
 144.8   0.1  776G 1.33G 20023 userli       0 S   8h53:24     0    4K python3.5 main_GPU.py
 144.0   0.1  776G 1.34G 20111 userli       0 S   8h48:52     0    4K python3.5 main_GPU.py

main_CPU.pymain_GPU.py相同,只是前者运行在CPU上,后者运行在GPU上。

为什么使用 GPU 的 TensorFlow 进程的 virtual sizeVIRT 列)比仅在 CPU 上运行的 TensorFlow 进程高得多(776GB vs. ~12GB)?

【问题讨论】:

    标签: python tensorflow


    【解决方案1】:

    正如您的链接所指出的那样,虚拟大小基于分配给程序的虚拟内存地址,并不(准确)代表程序存储或使用的数据量。虚拟内存地址可能指向 GPU 上每个 4 字节的位置,而每个地址可能代表 CPU 上的 1MB,因此这些地址的虚拟内存大小增加了约 33.000 倍。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-11
      • 1970-01-01
      • 2019-11-06
      • 1970-01-01
      • 2020-05-13
      相关资源
      最近更新 更多