models icon indicating copy to clipboard operation
models copied to clipboard

SintaxNet failes to allocate memory while using GPU

Open Shnurre opened this issue 10 years ago • 2 comments

I have Ubuntu 15.10, CUDA 7.5, cuDNN 4.0.7, GTX 970 card and I was trying to build syntaxnet from up-to-date models git repos with bazel 0.2.2b as is described here #248 by @David-Ba . After that I try to run syntaxnet/demo.sh but get the following:

`ismurov@smurov_unix:~/models/syntaxnet$ echo 'Bob brought the pizza to Alice.' | syntaxnet/demo.sh I external/org_tensorflow/tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so.7.5 locally

.......

I external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:925] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero I external/org_tensorflow/tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 0 with properties: name: GeForce GTX 970 major: 5 minor: 2 memoryClockRate (GHz) 1.228 pciBusID 0000:01:00.0 Total memory: 4.00GiB Free memory: 3.88GiB I external/org_tensorflow/tensorflow/core/common_runtime/gpu/gpu_init.cc:126] DMA: 0 I external/org_tensorflow/tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 0: Y I external/org_tensorflow/tensorflow/core/common_runtime/gpu/gpu_device.cc:838] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 970, pci bus id: 0000:01:00.0) I syntaxnet/term_frequency_map.cc:101] Loaded 46 terms from syntaxnet/models/parsey_mcparseface/label-map.

......

INFO:tensorflow:Building training network with parameters: feature_sizes: [12 20 20] domain_sizes: [ 49 51 64038] E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 3.46G (3719032832 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 3.12G (3347129344 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 2.80G (3012416256 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 2.52G (2711174656 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 2.27G (2440057088 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 2.04G (2196051200 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 1.84G (1976446208 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 1.66G (1778801664 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 1.49G (1600921600 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 1.34G (1440829440 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 1.21G (1296746496 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 1.09G (1167072000 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 1001.71M (1050364928 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 901.54M (945328384 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 811.38M (850795520 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 730.24M (765715968 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 657.22M (689144576 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 591.50M (620230144 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 532.35M (558207232 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 479.11M (502386688 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 431.20M (452148224 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 388.08M (406933504 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 349.27M (366240256 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 314.35M (329616384 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 282.91M (296654848 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 254.62M (266989568 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 229.16M (240290816 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 206.24M (216261888 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 185.62M (194635776 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:965] failed to allocate 167.06M (175172352 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY

......

INFO:tensorflow:Total processed documents: 0 INFO:tensorflow:Read 0 documents ` I also tried various other versions of bazel and cuDNN 5, but got the same error. It should also be noted that Syntaxnet without GPU support builds on my machine correctly and works as it is supposed to.

It is exactly the problem described by @orionr in #173 . I first tried to describe my problem there but I am unable to reopen that issue so I made a new one here

It appears that I did not manage to implement successfully the solution proposed by @borisstock in #173. I added config.gpu_options.allow_growth = True to all the files containing other modifications of config.gpu_options - files tensorflow/tensorflow/python/framework/test_util.py, tensorflow/tensorflow/python/kernel_tests/sparse_xent_op_test.py and tensorflow/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py. I seems though that I missed something essential.

Could please @borisstock or anyone else who managed to solve this problem specify where exactly should config.gpu_options.allow_growth = True be added or propose another solution to configure SyntaxNet with GPU

Shnurre avatar Sep 28 '16 13:09 Shnurre

Search for core/protobuf/config.proto and you can see the option. Pass the appropriately constructed config to your Python session.run(...) call.

concretevitamin avatar Sep 28 '16 23:09 concretevitamin

Hi, did you manage to solve the issue? I'm getting the same error with a 1080TI using cuda 8.0 and I haven't been able to solve the issue with the fixes proposed in #173

zerodarkzone avatar Dec 21 '17 16:12 zerodarkzone