Bug 102179

Summary: clEnqueueReadBuffer VM_PAGE FAULT
Product: Mesa Reporter: Janpieter Sollie <janpieter.sollie>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact: Default DRI bug account <dri-devel>
Severity: major    
Priority: medium    
Version: 17.2   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=100199
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 99553    
Attachments: clinfo output
gdb backtrace
dmesg output reporting page fault

Description Janpieter Sollie 2017-08-12 07:46:53 UTC
Created attachment 133450 [details]
clinfo output

I'm not sure whether this is a mesa bug, so if it's not: I'm sorry
Anyway, the problem:
I have 2 GCN cards in my system, a 7700 and a R9 nano
I'm using both with amdgpu on linux-4.13.0-r4
clinfo attached.
My program causes a GPU fault on the 7700 when reading from a buffer.
dmesg part attached
this problem does not occur on the CPU or the R9 nano card
GDB backtrace of thread calling the clEnqueueReadBuffer attached

If this is a known bug, or not yours, I'm sorry
Comment 1 Janpieter Sollie 2017-08-12 07:48:04 UTC
Created attachment 133451 [details]
gdb backtrace
Comment 2 Janpieter Sollie 2017-08-12 07:50:03 UTC
Created attachment 133452 [details]
dmesg output reporting page fault
Comment 3 Janpieter Sollie 2017-08-12 14:40:54 UTC
interesting note:
the following code allows me to execute the clEnqueueReadBuffer:
//set kernel arguments, limited to 1
    clSetKernelArg ( devdb[nr_of_devices].kernel, 0, sizeof(devdb[nr_of_devices].output), &devdb[nr_of_devices].output);

//run kernel
clEnqueueNDRangeKernel(..)
//read buffer
clEnqueueReadBuffer (((device*)device_obj)->command_queue, ((device*)device_obj)->output, CL_FALSE, 0, 16, ((device*)device_obj)->host_output, 0, NULL, NULL);

while it does not work with any 2nd, 3rd, ... kernel parameter, eg:
clSetKernelArg ( devdb[nr_of_devices].kernel, 0, sizeof(devdb[nr_of_devices].output), &devdb[nr_of_devices].output);
clSetKernelArg ( devdb[nr_of_devices].kernel, 1, sizeof(devdb[nr_of_devices].output2), &devdb[nr_of_devices].output2);

hangs at reading output. but no warning of VM_PAGE_FAULTS, these occur when output is the last argument

because I think this is a blocker for most OpenCL users to get their data back, I'm increasing it to major (also, this cannot be analyzed easily: every time the call hangs, I have to reboot my pc, as the process becomes a zombie)
Comment 4 GitLab Migration User 2019-09-25 17:59:44 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1275.

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.