# Gpu memory allocation error and volatility

**URL:** <https://discuss.pytorch.org/t/gpu-memory-allocation-error-and-volatility/15878>\
**Category:** Uncategorized\
**Created:** [April 3, 2018, 1:02pm UTC](https://discuss.pytorch.org/t/gpu-memory-allocation-error-and-volatility/15878 "2018-04-03T13:02:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![gody7334](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/g/77aa72/32.png) [@gody7334](https://discuss.pytorch.org/u/gody7334)\
**Post date:** [June 18, 2019, 9:37am UTC](https://discuss.pytorch.org/t/gpu-memory-allocation-error-and-volatility/15878/2 "2019-06-18T09:37:47Z")

</div>

Hi,  
I had similar issue and spent several days to figure out.  
In my case, I turned on torch.backend.cudnn.benchmark and it keeps evaluate on each batch which also causing memory fluctuating.

> [@What does torch.backends.cudnn.benchmark do?](https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936):
>
> whats the difference when setting it True or False?

Hope this will help.

---

_[View the full topic](https://discuss.pytorch.org/t/gpu-memory-allocation-error-and-volatility/15878)._
