Failing to free GPU memory on cleared/replaced/gathered variables: 2017a
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
D. Plotnick
el 27 de Jun. de 2018
Editada: D. Plotnick
el 29 de Jun. de 2018
Hello all, I am running into an out of memory error on my GPU (8 GB, GTX 1080). I have drilled down to the code segment that keeps throwing the error, and it appears to be an issue with Matlab failing to free memory on the gpu after calculation. Specifically, this is occurring after an interp2 command.
I am attaching a MWE as a PDF. Long story short, this shows that after the interp2 command, a sizeable block of GPU memory never gets freed up even after all of the workspace variables on the GPU being cleared, gathered, or replaced. This is a major issue if the result of the interp2 operation is large enough that gather(gpuData) causes an out of memory error; there is no way to pull the data off of the GPU without resetting the GPU, which wipes the data.
Is this a 2017a issue? Any help would be appreciated.
0 comentarios
Respuesta aceptada
Joss Knight
el 28 de Jun. de 2018
It's difficult to say exactly what is going on here, however I'm fairly sure that it is the cublas context that is occupying memory on the first call. This is perfectly normal and doesn't constitute any kind of memory leak. You can run this computation repeatedly from this point on and the overall memory usage remains the same. I believe it's cublas because if I replace your function with a simple call to v.*v I don't see this behaviour; whereas if I call v*v (a cublas call) I do. I think cublas is pooling a lot of memory and kernels and this is not reported as free memory.
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre GPU Computing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!