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:[email protected]] On Behalf Of Gao, 
Sanshan
Sent: Monday, May 04, 2015 6:05 PM
To: Guo, Yejun
Cc: [email protected]
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" <[email protected]<mailto:[email protected]>>
发送时间:2015-05-04 09:58:24 (星期一)
收件人: "Gao, Sanshan" <[email protected]<mailto:[email protected]>>, 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
抄送:
主题: 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:[email protected]<mailto:[email protected]>]
 On Behalf Of Gao, Sanshan
Sent: Sunday, May 03, 2015 3:56 PM
To: [email protected]<mailto:[email protected]>
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.






_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to