intel_do_flush_locked failed Input/Output error

Sometimes while running apps using OpenGL, the following message comes in the command line where I run the app. I have a Sandy Bridge integrated graphics card (the same as in the bug reports)

intel_do_flush_locked failed: Input/output error

Running any subsequent OpenGL apps fail with the same error. Also this is displayed in the system log

[ 7730.683403] [drm:i915_wait_request] *ERROR* i915_wait_request returns -11 (awaiting 1322416 at 1322415, next 1322417)

I have seen many bugs about this but none of them seem to have a solution. Is there any workaround for this (apart from disabling OpenGL)?


Try LIBGL_ALWAYS_SOFTWARE=1 ./yourprogram


The following seems to fixed the issue for me:

export hiz=false
export INTEL_HIZ=0
export INTEL_SEPARATE_STENCIL=0

If it doesn't help try

sudo intel_reg_write 0x2120 0x1206800

Source.