How can I flush GPU memory using CUDA (physical reset is unavailable)

后端 未结 7 808
不知归路
不知归路 2020-12-13 01:39

My CUDA program crashed during execution, before memory was flushed. As a result, device memory remained occupied.

I\'m running on a GTX 580, for which nvidia-

7条回答
  •  失恋的感觉
    2020-12-13 02:18

    on macOS (/ OS X), if someone else is having trouble with the OS apparently leaking memory:

    • https://github.com/phvu/cuda-smi is useful for quickly checking free memory
    • Quitting applications seems to free the memory they use. Quit everything you don't need, or quit applications one-by-one to see how much memory they used.
    • If that doesn't cut it (quitting about 10 applications freed about 500MB / 15% for me), the biggest consumer by far is WindowServer. You can Force quit it, which will also kill all applications you have running and log you out. But it's a bit faster than a restart and got me back to 90% free memory on the cuda device.

提交回复
热议问题