Skip to content

why does mem_alloc take very long time sometimes, and it's a random behavior #363

Discussion options

You must be logged in to vote

Memory allocation is shockingly slow in CUDA at times. As a user, I am not aware of any way to fix that, however PyCUDA does offer a way to circumvent it, through the use of memory pools:

https://documen.tician.de/pycuda/util.html#device-based-memory-pool

These work by simply not returning freed memory to the system, but instead retaining the memory and reusing allocations when requests for similarly-sized memory occur later.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MuYu-zhi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants