[Beignet] clReleaseConstext() problem when use CL_MEM_USE_HOST_PTR

Gao, Sanshan gss at mail.ustc.edu.cn
Fri May 8 06:48:34 PDT 2015


Hello, everyone,


I have a problem when using CL_MEM_USE_HOST_PTR.


1. I want to use CL_MEM_USE_HOST_PTR to create a buffer of self-defined structure. After operated by GPU, I will reuse the memory in host.
The main method I use is:
... ...
clCreateBuffer(..., (void*)p, ...);
... ...
clSetKernelArg();
clEnqueueNDRangeKernel();
clFinish();
MyFunction(...,p, ...); //reuse the memory derectly pointed by p
...
clReleaseContext(context); // Failed to release test userptr object! (9) i915 kernel driver may not be sane!


...


Problem: clReleaseContext() return CL_SUCCESS, but hints "Failed to release test userptr object! (9) i915 kernel driver may not be sane!", and then, continue to run.


2. "./utest_run runtime_use_host_ptr_buffer" is OK, and I have read sample code runtime_use_host_ptr_buffer.cpp, main difference is:
mycode:|sample of beignet:
|pp = clEnqueueMapBuffer()
clFinish();|MyFunction(..., pp, ...);
MyFunction(..., p, ...);|clEnqueueUnmapMemObject(..., pp, ...);


Question: 
Does this shared buffer must be used in host program just by pp, returned by map function, but not p?  
Does this mean that, if I put the memory to GPU, I cannot control this memory again, but just via map function?
Does have some other methods, that I can get the right to control this memory in host again?


Hope for helps! Thank you very much!! :-) 





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20150508/ee14ef72/attachment.html>


More information about the Beignet mailing list