[Beignet] Shared Host Memory but not Share

Guo, Yejun yejun.guo at intel.com
Mon May 4 18:52:26 PDT 2015


the seg fault issue did not reproduce at my side.  Maybe you can try:


-          Beignet/utest also invokes clGetDeviceIDs() and successful to run, just compare it with your simple example step by step to check the difference.

-          Run your simple example within gdb, to check the crash point inside beignet (built with Debug version)


From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Gao, Sanshan
Sent: Monday, May 04, 2015 6:05 PM
To: Guo, Yejun
Cc: beignet at lists.freedesktop.org
Subject: Re: [Beignet] Shared Host Memory but not Share

Thanks for your guidance!!

Now:
My kernel version==4.0.0 libdrc-dev version==2.4.56
And after reading sample code, I realize that may be the reason is host memory should be aligned 64.

So:
I "sudo apt-get remove libdrm-dev" and install libdrm 2.4.60.2 (link:    https://launchpad.net/ubuntu/+archive/primary/+files/libdrm_2.4.60.orig.tar.gz)
It depends "sudo apt-get install libpciaccess-dev".

But:
After all of this, the run test in Beignet is OK, but one of my previous simple example has "Segmentation fault (core dumped)" when run, although compiling is OK. Error function is clGetDeviceIDs().
After rebuild and install the latest Beignet, problem is still.

I don't know why? Could you give me some guidance? (attachments are: log file and simple code)


769  summary:
770  ----------
771   total: 681
772   run: 680
773   pass: 680
774   fail: 0
775   pass rate: 1.000000





-----原始邮件-----
发件人:"Guo, Yejun" <yejun.guo at intel.com<mailto:yejun.guo at intel.com>>
发送时间:2015-05-04 09:58:24 (星期一)
收件人: "Gao, Sanshan" <gss at mail.ustc.edu.cn<mailto:gss at mail.ustc.edu.cn>>, "beignet at lists.freedesktop.org<mailto:beignet at lists.freedesktop.org>" <beignet at lists.freedesktop.org<mailto:beignet at lists.freedesktop.org>>
抄送:
主题: RE: [Beignet] Shared Host Memory but not Share
Please refer to the sample code in utests/runtime_use_host_ptr_buffer.cpp and  kernels/runtime_use_host_ptr_buffer.cl

To avoid internal copy, it requires libdrm version >= 2.4.58 and linux kernel version >= 3.16

From: Beignet [mailto:beignet-bounces at lists.freedesktop.org<mailto:beignet-bounces at lists.freedesktop.org>] On Behalf Of Gao, Sanshan
Sent: Sunday, May 03, 2015 3:56 PM
To: beignet at lists.freedesktop.org<mailto:beignet at lists.freedesktop.org>
Subject: [Beignet] Shared Host Memory but not Share

Hi, alls,

I want to use CL_MEM_USE_HOST_PTR to create a buffer object which shares host memory, so the changes to the elements in kernel can be used by host program.

But the result is that, I have changed the element in kernel, but the element in host program has not changed. I don't know why? Does this method still be a copy of host memory, so the change is not done to the host memory, but only device memory?

Hope for helps!

Device: GIGA Mini PC with core i7 and Iris Pro, integrated GPU
Kernel function:
 47 __kernel void PacketsIndexCalculation(
 48                          const unsigned int     packets_info_size,
 49                          __global packet_info_t  *packets_info,
 50                          const unsigned int     flow_table_size )
 51 {
 52     int gid = get_global_id(0);
 53     __global packet_info_t *p = packets_info + gid;
 54
 55     //calculate hash value
 56     p->index = ( ((p->flow_id).src_ip & 0xff) | (((p->flow_id).dst_ip & 0xff)<<8) |
 57                  (((p->flow_id).src_port & 0xff)<<16) | (((p->flow_id).dst_port & 0xff)<<24) )%flow_table_size;
 58
 59 }
Problem:
 In host program, the memory pointed by &(p->index) has not changed by kernel function.






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


More information about the Beignet mailing list