pytorch_knn_cuda icon indicating copy to clipboard operation
pytorch_knn_cuda copied to clipboard

Illegal memory access with large N*M

Open agarret7 opened this issue 6 years ago • 6 comments

Tried on 10,000 reference points, 100 query points, and 3 feature dimensions, this crashes with the error:

RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at /pytorch/torch/lib/THC/generic/THCTensorCopy.c:70

The error does not appear when executing the KNN code, but only when trying to assign or access any data on the GPU (including the results) after the code is called. Tested with GeForce GTX 1080 with 8 GB of VRAM.

agarret7 avatar Mar 28 '18 22:03 agarret7

I am facing the exact same issue have you found any solution??

anshulpaigwar avatar Apr 27 '18 12:04 anshulpaigwar

Bump

pclucas14 avatar May 04 '18 20:05 pclucas14

Same problem.

WangZixuan avatar May 18 '18 08:05 WangZixuan

I suspect I found the source of this issue: The algorithm computes ALL pair-wise distances ref_nbxquery_nb, however, the space allocated for these distances is only kxquery_nb therefore there is a memory leak. I forked this repository here and fixed this problem there.

shaibagon avatar Aug 13 '18 09:08 shaibagon

Same problem...

j96w avatar Sep 12 '18 13:09 j96w

I suspect I found the source of this issue: The algorithm computes ALL pair-wise distances ref_nbxquery_nb, however, the space allocated for these distances is only kxquery_nb therefore there is a memory leak. I forked this repository here and fixed this problem there.

Thanks, Bagon. Your fork works well now.

j96w avatar Sep 26 '18 12:09 j96w