simple-faster-rcnn-pytorch icon indicating copy to clipboard operation
simple-faster-rcnn-pytorch copied to clipboard

CUDA_ERROR_INVALID_HANDLE: invalid resource handle occured when using another gpu instead of the default card(0)

Open chrisway613 opened this issue 4 years ago • 1 comments

My server has multi gpus, when I change '.cuda()' to '.cuda(1)', exception occured: cupy.cuda.driver.CUDADriverError: CUDA_ERROR_INVALID_HANDLE: invalid resource handle

I also add 'os.environ["CUDA_VISIBLE_DEVICES"] = 1', but it doesn't work.

Can anyone tell me how to solve it?

chrisway613 avatar Mar 31 '20 10:03 chrisway613

try to change all .cuda() to .to("cuda:1"),

or at the very beginning of code write torch.cuda.set_device(1) and keep all .cuda() unchanged

300LiterPropofol avatar Apr 01 '20 08:04 300LiterPropofol