Bug 110507 - [Regression] [Bisected] assert in fragment shader compilation when SIMD32 is enabled
Summary: [Regression] [Bisected] assert in fragment shader compilation when SIMD32 is ...
Status: NEW
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Rafael Antognolli
QA Contact: Intel 3D Bugs Mailing List
Keywords: bisected, regression
: 110905 (view as bug list)
Depends on:
Reported: 2019-04-24 11:25 UTC by Iago Toral
Modified: 2019-06-12 15:11 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:

Minimal SDL2 program that reproduces the problem (713 bytes, text/x-csrc)
2019-04-24 11:25 UTC, Iago Toral

Note You need to log in before you can comment on or make changes to this bug.
Description Iago Toral 2019-04-24 11:25:27 UTC
Created attachment 144082 [details]
Minimal SDL2 program that reproduces the problem

I filed this for i965, but the issue is in the shader compiler, so it also affects the Vulkan driver and, presumably, Iris.

The problem only happens when INTEL_DEBUG=do32 is used, in which case SDL2 generates a shader that hits the following assertion:

../src/intel/compiler/brw_fs.cpp:1745: void fs_visitor::assign_urb_setup(): Assertion `inst->src[i].offset < REG_SIZE / 2' failed.

I bisected the regression to this commit:

commit c0504569eac5e5c305e9f0c240e248aca9d8891f (HEAD -> master)
Author: Rafael Antognolli <rafael.antognolli@intel.com>
Date:   Fri Oct 19 15:44:15 2018 -0700

    intel/fs: Move the scalar-region conversion to the generator.
    Move the scalar-region conversion from the IR to the generator, so it
    doesn't affect the Gen11 path. We need the non-scalar regioning
    for a later lowering pass that we are adding.
    v2: Better commit message (Matt)
    Reviewed-by: Matt Turner <mattst88@gmail.com>

I am attaching a minimal SDL2 sample program that reproduces the problem.
Comment 1 Eero Tamminen 2019-06-12 13:33:19 UTC
*** Bug 110905 has been marked as a duplicate of this bug. ***
Comment 2 Eero Tamminen 2019-06-12 13:39:15 UTC
(In reply to Iago Toral from comment #0)
> I am attaching a minimal SDL2 sample program that reproduces the problem.

This is enough to reproduce: INTEL_DEBUG=do32 glxgears
Comment 3 Eero Tamminen 2019-06-12 13:45:16 UTC
Valgrind doesn't give any additional info, just abort backtrace (same as I got with systemd-coredump from Weston when enabling SIMD32 heuristics):
==5950== Process terminating with default action of signal 6 (SIGABRT): dumping core
==5950==    at 0x48CE6A5: raise (in /usr/lib64/libc-2.29.so)
==5950==    by 0x48AF860: abort (in /usr/lib64/libc-2.29.so)
==5950==    by 0x48AF736: ??? (in /usr/lib64/libc-2.29.so)
==5950==    by 0x48BF545: __assert_fail (in /usr/lib64/libc-2.29.so)
==5950==    by 0x6BEBC7E: fs_visitor::assign_urb_setup() (brw_fs.cpp:1745)
==5950==    by 0x6BFB847: fs_visitor::run_fs(bool, bool) (brw_fs.cpp:7664)
==5950==    by 0x6BFD659: brw_compile_fs (brw_fs.cpp:8039)
==5950==    by 0x66ED3FB: brw_codegen_wm_prog (brw_wm.c:123)
==5950==    by 0x66EE44F: brw_fs_precompile (brw_wm.c:590)
==5950==    by 0x66DADD3: brw_shader_precompile (brw_link.cpp:56)
==5950==    by 0x66DADD3: brw_link_shader (brw_link.cpp:374)
==5950==    by 0x68E9798: _mesa_glsl_link_shader (ir_to_mesa.cpp:3170)
==5950==    by 0x6910023: create_new_program (ff_fragment_shader.cpp:1131)
==5950==    by 0x6910023: _mesa_get_fixed_func_fragment_program (ff_fragment_shader.cpp:1161)

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.