Bug 102179 - clEnqueueReadBuffer VM_PAGE FAULT
Summary: clEnqueueReadBuffer VM_PAGE FAULT
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: 17.2
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
Depends on:
Blocks: 99553
  Show dependency treegraph
Reported: 2017-08-12 07:46 UTC by Janpieter Sollie
Modified: 2019-09-25 17:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

clinfo output (7.73 KB, text/plain)
2017-08-12 07:46 UTC, Janpieter Sollie
gdb backtrace (9.61 KB, text/plain)
2017-08-12 07:48 UTC, Janpieter Sollie
dmesg output reporting page fault (6.92 KB, text/plain)
2017-08-12 07:50 UTC, Janpieter Sollie

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
//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.