# RuntimeError: HIP out of memory

**URL:** <https://discuss.pytorch.org/t/runtimeerror-hip-out-of-memory/100470>\
**Category:** Uncategorized\
**Created:** [October 24, 2020, 8:35am UTC](https://discuss.pytorch.org/t/runtimeerror-hip-out-of-memory/100470 "2020-10-24T08:35:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![apalazzi](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/a/ea666f/32.png) [@apalazzi](https://discuss.pytorch.org/u/apalazzi)\
**Post date:** [October 24, 2020, 8:35am UTC](https://discuss.pytorch.org/t/runtimeerror-hip-out-of-memory/100470/1 "2020-10-24T08:35:26Z")

</div>

Hi,

I’m using pytorch with an AMD card and rocm; I can train my model but when I try to detect something with it I run into an out of memory error:

```auto
RuntimeError: HIP out of memory. Tried to allocate 138.00 MiB (GPU 0; 7.98 GiB total capacity; 1.55 GiB already allocated; 6.41 GiB free; 1.57 GiB reserved in total by PyTorch)

```

It seems to me however that there is memory available, so why it fails to allocate the memory?  
Is it a rocm bug?

Thanks,  
Andrea

---

<div class="post-metadata">

**Author:** ![apalazzi](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/a/ea666f/32.png) [@apalazzi](https://discuss.pytorch.org/u/apalazzi)\
**Post date:** [October 24, 2020, 10:08am UTC](https://discuss.pytorch.org/t/runtimeerror-hip-out-of-memory/100470/2 "2020-10-24T10:08:27Z")

</div>

I rebooted the system and now it works, I guess there was some core component that crashed and the system was in an unclean state.

Bye  
Andrea
