Skip to content

How can I limit the usage of cuda memory to avoid CUDA out of memory. #950

Closed
@toolgood

Description

@toolgood

System.Runtime.InteropServices.ExternalException:“CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 23.99 GiB total capacity; 21.46 GiB already allocated; 0 bytes free; 23.18 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
Exception raised from malloc at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\c10\cuda\CUDACachingAllocator.cpp:704 (most recent call first):
00007FFB7D5CAD0200007FFB7D5CACA0 c10.dll!c10::Error::Error [ @ ]
00007FFB7D59524500007FFB7D5951D0 c10.dll!c10::OutOfMemoryError::OutOfMemoryError [ @ ]
00007FFB7D63DC8400007FFB7D63C1D0 c10_cuda.dll!c10::cuda::CUDACachingAllocator::init [ @ ]
00007FFB7D63DD0700007FFB7D63C1D0 c10_cuda.dll!c10::cuda::CUDACachingAllocator::init [ @ ]
00007FFB7D6216F0 c10_cuda.dll! [ @ ]
00007FFAD36B16F100007FFAD36B1620 torch_cpu.dll!at::detail::empty_generic [ @ ]
00007FFB7DA3DD9200007FFB7DA3DCA0 torch_cuda_cpp.dll!at::detail::empty_cuda [ @ ]
00007FFB7DA3DBC200007FFB7DA3DA80 torch_cuda_cpp.dll!at::detail::empty_cuda [ @ ]
000001F9CA76722F000001F9CA740370 torch_cuda_cu.dll!at::cuda::set__symint [ @ ]
00007FFAD36DFF2D00007FFAD36DFA10 torch_cpu.dll!at::TensorIteratorBase::fast_set_up [ @ ]
00007FFAD36DBF6700007FFAD36DBEE0 torch_cpu.dll!at::TensorIteratorBase::build [ @ ]
00007FFAD36DC58000007FFAD36DC490 torch_cpu.dll!at::TensorIteratorBase::build_borrowing_binary_op [ @ ]
000001F9CA8386F9000001F9CA7E32E0 torch_cuda_cu.dll!at::cuda::where_outf [ @ ]
000001F9CA72863F000001F9CA6E6010 torch_cuda_cu.dll!at::cuda::bucketize_outf [ @ ]
00007FFAD3F4AA0800007FFAD3F4A980 torch_cpu.dll!at::_ops::mul_Tensor::redispatch [ @ ]
00007FFAD53FF71500007FFAD53B6BD0 torch_cpu.dll!torch::autograd::GraphRoot::apply [ @ ]
00007FFAD53C9C3A00007FFAD53B6BD0 torch_cpu.dll!torch::autograd::GraphRoot::apply [ @ ]
00007FFAD3EDC24A00007FFAD3EDC0D0 torch_cpu.dll!at::_ops::mul_Tensor::call [ @ ]
00007FFAD36762C400007FFAD36762B0 torch_cpu.dll!at::Tensor::mul [ @ ]
00007FFB68008A3700007FFB680089C0 LibTorchSharp.DLL!THSTensor_mul [ @ ]
00007FFB093A0633 ! [ @ ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions