clMathLibraries/clBLAS

event (firstDotCall) leak at xdot.c

Closed this issue · 7 comments

ache7 commented

Cause "out of memory" errors with intel opencl drivers.
Here's the forum thread:
https://software.intel.com/en-us/forums/opencl/topic/701907
And bugfix:
ache7@959372f

kknox commented

Hi @ache7
Can you make a PR targeting our /develop branch? I'll merge this.

ache7 commented

Here #297

ache7 commented

Maybe it's better to initialize firstDotCall to NULL and release firstDotCall event before freeSolutionSeq(&seq). Differs if first makeSolutionSeq or executeSolutionSeq failed.

ache7 commented

Also, when I search for "eventWaitList, &first" in sources - there is more functions with unreleased events, all these events come to "step->event = events + j;" in makeSolutionSeq, so can be freed automatically somewhere in freeSolutionSeq -> freeSolutionStep -> releaseStepImgs, but I don't see clReleaseEvent() calls. Someone must check this, I don't know code well enough.

kknox commented

Hi @ache7
I have made a new branch in my fork that fixes the many events you mention in this thread. It passes my unit tests.

If you have time, would you mind testing in your environment? If not, I'll merge my branch as it's already passing my tests.

ache7 commented

Sorry, I don't use library directly, only through other libraries (from cltorch), so can't test it thoroughly. Seems that neural nets use only xdot() from functions with event leaks.

kknox commented

Thanks for replying; I'll close your PR and merge in my fixes. I think it should square you away.