torch / torch7

http://torch.ch
Other
8.97k stars 2.38k forks source link

Error while upgrading a variable to CUDA variable #1140

Open jagadeesh09 opened 6 years ago

jagadeesh09 commented 6 years ago

Hi

I have installed torch in my machine which is having 12 GB GPU memory, I am performing simple operations like below.

a = torch.rand(5,6) require 'cutorch' a = a:cuda() I am getting an error like below.

THCudaCheck FAIL file=/home/gpu/torch/extra/cutorch/lib/THC/generic/THCStorage.cu line=66 error=2 : out of memory /home/gpu/torch/install/share/lua/5.1/cutorch/Tensor.lua:14: cuda runtime error (2) : out of memory at /home/gpu/torch/extra/cutorch/lib/THC/generic/THCStorage.cu:66 stack traceback: [C]: in function 'resize' /home/gpu/torch/install/share/lua/5.1/cutorch/Tensor.lua:14: in function 'cuda' [string "a = a:cuda()"]:1: in main chunk [C]: in function 'xpcall' /home/gpu/torch/install/share/lua/5.1/trepl/init.lua:679: in function 'repl' .../gpu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:204: in main chunk [C]: at 0x00405d50

What could be the reason for the above error and how to overcome this error?

Thanks