Bug 105934

Summary: Gpu Hang with timestamp queries and compute dispatches on Intel HD 5500
Product: Mesa Reporter: mankeli
Component: Drivers/DRI/i915Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact: Default DRI bug account <dri-devel>
Severity: major    
Priority: medium CC: eero.t.tamminen
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Small program with two compute dispatches and draw

Description mankeli 2018-04-06 21:42:09 UTC
Running OpenGL program with two glDispatch() calls, causes gpu hang on HD Graphics 5500.

Program basically does:
if (1)
{
	glUseProgram(computeprogram);
	glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, ssbo_test);
	glDispatchCompute(256/4, 256/4, 256/2);
	glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT);
}
if (1)
{
	glUseProgram(computeprogram);
	glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, ssbo_test);
	glDispatchCompute(256/4, 256/4, 256/2);
	glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT);
}
.. and then simple one-triangle fullscreen pass to main framebuffer (0) using that SSBO.

When both of those are enabled, my computer nearly hangs and dmesg reports:
[127049.481163] drm/i915: Resetting chip after gpu hang.

But if only one of those is enabled, everything is ok, compute dispatch takes 13ms and debug output renders on the screen.
Comment 1 mankeli 2018-04-08 20:44:53 UTC
Scratch previous comment: It seems that the GPU hang is actually caused by GL_TIMESTAMP queries between two compute dispatches. I've attached test program to exploit this behavior.
Comment 2 mankeli 2018-04-08 20:46:16 UTC
Created attachment 138687 [details]
Small program with two compute dispatches and draw
Comment 3 GitLab Migration User 2019-09-18 19:40:59 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/783.

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.