Bug 98490

Summary: Cannot map or read sub-buffer of CL_MEM_ALLOC_HOST_PTR buffer
Product: Beignet Reporter: Kai <kai.scorpio>
Component: BeignetAssignee: Guo Yejun <yejun.guo>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: xiuli.pan, yejun.guo
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Minimal example to reproduce

Description Kai 2016-10-29 10:53:48 UTC
Created attachment 127602 [details]
Minimal example to reproduce

I cannot map or read from a sub-buffer if the parent buffer was created with CL_MEM_ALLOC_HOST_PTR. Attached file is a minimal test case that shows this, on my machine it prints '-12' and then exits with status code 1. I would expect it to return 0 with no output. Removing CL_MEM_ALLOC_HOST_PTR from clCreateBuffer fixes the issue.

If I understand correctly, this error code is CL_MAP_FAILURE, which should not be possible if the buffer was allocated with CL_MEM_ALLOC_HOST_PTR, which should be inherited by sub-buffers.

Otherwise all unit tests pass except profiling_exec on git master.

Device information from utests is:

> device_name "Intel(R) HD Graphics Haswell Ultrabook GT2 Mobile"

Please let me know if I have misunderstood the specification or can provide any more information.
Comment 1 Guo Yejun 2016-12-01 05:47:44 UTC
thanks Kai, the patch is in code review now, see https://lists.freedesktop.org/archives/beignet/2016-December/008277.html
Comment 2 Xiuli Pan 2016-12-01 07:15:10 UTC
Hi all,

The patch LGTM and will soon be merged in master.

Thanks
Xiuli
Comment 3 Kai 2016-12-03 11:21:02 UTC
Seems to be fixed in current master, thanks all!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.