OpenCL FreeDataSpace thrown exception


Hi there,

I compiled my own model with opencl as backend.
The model can inference normally, but it will throw an exception during opencl free stage.

The exception is an access violation reading occurred in the following function:
(Exception thrown at 0x00007FFFD62A669F (ntdll.dll))

Is anyone can suggest how to debug and solve this problem?


Update the current status:

I can pin down the suspected mptr is allocated in line41 = device->AllocDataSpace(ctx, nbytes, kTempAllocaAlignment, type);

I check the error code of allocation is sucess, but somehow in the program end, when workspace need to release at line99 (void Release(TVMContext ctx, DeviceAPI* device))

It just thrown access violation exception when releasing the suspected mptr.

I also check the mptr is only released once.

My hardware is Nvidia GTX 1060.

Any idea?


The allocation is called by a fused kernel:
in my compiled dynamic library.