mvsnerf icon indicating copy to clipboard operation
mvsnerf copied to clipboard

RuntimeError: CUDA out of memory.

Open zhichengLuxx opened this issue 2 years ago • 2 comments

No matter what GPU I use, I always report an error:

File "/data/mvsnerf/models.py", line 881, in build_volume_costvar_img volume_sq_sum = volume_sq_sum + warped_volume ** 2

RuntimeError: CUDA out of memory. Tried to allocate 936.00 MiB (GPU 0; 7.93 GiB total capacity; 5.93 GiB already allocated; 156.50 MiB free; 6.87 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

How to solve this problem, many thanks.

zhichengLuxx avatar May 06 '22 13:05 zhichengLuxx

GPU with 8GB capacity may too small, previous I used 12GB 2080Ti, a larger GPU memory should be able to resolve this issue.

apchenstu avatar Jun 30 '22 01:06 apchenstu

No matter what GPU I use, I always report an error:

File "/data/mvsnerf/models.py", line 881, in build_volume_costvar_img volume_sq_sum = volume_sq_sum + warped_volume ** 2

RuntimeError: CUDA out of memory. Tried to allocate 936.00 MiB (GPU 0; 7.93 GiB total capacity; 5.93 GiB already allocated; 156.50 MiB free; 6.87 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

How to solve this problem, many thanks.

8G显存偏小了,调调num_workers试试,8肯定不行,调成4或者2试下,另外batchsize也调小点

54HaoHao-hue avatar Jul 07 '22 07:07 54HaoHao-hue