Bug 98490 - Cannot map or read sub-buffer of CL_MEM_ALLOC_HOST_PTR buffer
Summary: Cannot map or read sub-buffer of CL_MEM_ALLOC_HOST_PTR buffer
Status: RESOLVED FIXED
Alias: None
Product: Beignet
Classification: Unclassified
Component: Beignet (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Guo Yejun
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-29 10:53 UTC by Kai
Modified: 2016-12-05 02:31 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Minimal example to reproduce (2.12 KB, text/x-c)
2016-10-29 10:53 UTC, Kai
Details

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.