如何解释在GPGPU上构建和执行计算图的TensorFlow输出?
给定以下使用python API执行任意tensorflow脚本的命令。
python3 tensorflow_test.py > out
第一部分stream_executor
看起来像是它的加载依赖项。
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally
什么是NUMA
节点?
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:900] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
我假设这是它找到可用的GPU的时候
I tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 0 with properties:
name: Tesla K40c
major: 3 minor: 5 memoryClockRate (GHz) 0.745
pciBusID 0000:01:00.0
Total memory: 11.25GiB
Free memory: 11.15GiB
一些gpu初始化?什么是DMA?
I tensorflow/core/common_runtime/gpu/gpu_init.cc:126] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:755] Creating TensorFlow device (/gpu:0) -> (device: 0, name: Tesla K40c, pci bus id: 0000:01:00.0)
为什么抛出错误E
E tensorflow/stream_executor/cuda/cuda_driver.cc:932] failed to allocate 11.15G (11976531968 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
对pool_allocator
功能的一个很好的回答:https://stackoverflow.com/a/35166985/4233809
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:244] PoolAllocator: After 3160 get requests, put_count=2958 evicted_count=1000 eviction_rate=0.338066 and unsatisfied allocation rate=0.412025
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:256] Raising pool_size_limit_ from 100 to 110
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:244] PoolAllocator: After 1743 get requests, put_count=1970 evicted_count=1000 eviction_rate=0.507614 and unsatisfied allocation rate=0.456684
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:256] Raising pool_size_limit_ from 256 to 281
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:244] PoolAllocator: After 1986 get requests, put_count=2519 evicted_count=1000 eviction_rate=0.396983 and unsatisfied allocation rate=0.264854
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:256] Raising pool_size_limit_ from 655 to 720
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:244] PoolAllocator: After 28728 get requests, put_count=28680 evicted_count=1000 eviction_rate=0.0348675 and unsatisfied allocation rate=0.0418407
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:256] Raising pool_size_limit_ from 1694 to 1863
发布于 2016-04-26 04:03:32
关于NUMA -- https://software.intel.com/en-us/articles/optimizing-applications-for-numa
粗略地说,如果您有双插槽CPU,它们将各自拥有自己的内存,并且必须通过较慢的QPI链路访问另一个处理器的内存。因此,每个CPU+memory都是一个NUMA节点。
您可能会将两个不同的NUMA节点视为两个不同的设备,并构建网络以针对不同的节点内/节点间带宽进行优化
然而,我不认为TF中现在有足够的连接来做这件事。检测也不起作用--我刚刚在一台具有2个NUMA节点的机器上进行了尝试,它仍然打印出相同的消息,并初始化为1个NUMA节点。
DMA =直接存储器访问。你可以在不使用CPU的情况下把东西从一个图形处理器复制到另一个图形处理器(即通过NVlink)。NVLink集成还没有实现。
就错误而言,TensorFlow试图分配接近GPU最大内存的内存,这样听起来就像你的一些GPU内存已经被分配给了其他东西,分配失败了。
您可以像下面这样做,以避免分配如此多的内存
config = tf.ConfigProto(log_device_placement=True)
config.gpu_options.per_process_gpu_memory_fraction=0.3 # don't hog all vRAM
config.operation_timeout_in_ms=15000 # terminate on long hangs
sess = tf.InteractiveSession("", config=config)
发布于 2017-05-02 14:58:47
successfully opened CUDA library xxx locally
意味着库已经加载,但这并不意味着它将是used.successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
意味着您的内核不支持NUMA。您可以阅读有关NUMA和here.Found device 0 with properties:
的信息,您可以使用1个here。它列出了这个图形处理器的属性。failed to allocate 11.15G
的更多信息该错误清楚地解释了发生这种情况的原因,但是如果不查看代码就很难知道为什么需要这么多内存。this answer中对
https://stackoverflow.com/questions/36838770
复制相似问题