summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2022-12-07 12:00:33 -0800
committerEric Engestrom <eric@engestrom.ch>2022-12-14 20:47:01 +0000
commitd936394cf49f896429bf53d3ff95dd026c32b2ce (patch)
tree2843a6d95e2174c86cf373edc32fef7879c3973b
parent75e55ca05a0c67c4f9785f453563c281a5251d1d (diff)
downloadmesa-d936394cf49f896429bf53d3ff95dd026c32b2ce.tar.gz
intel/compiler: Set NoMask on cr0 access for float controls mode
This is trying to clear a bit in the control register. However, it's executing with whatever channel mask happens to be active. Typically this is the one at the start of the program, so at least some channels will be active. Typically the first channel will be active due to packed dispatch, but that's not always guaranteed. Without NoMask, the float controls writes may randomly not happen. Recent GPUs also seem to have a hang issue when the first instruction in the shader doesn't have any active channels. Having an instruction with NoMask at the start of the program works around the issue. See HSD bug 14017989577. In our case, the float controls preamble was breaking that restriction every time, causing us to run into this problem frequently. Thanks to Tapani Pälli for finding this hang issue, and Francisco Jerez and Lionel Landwerlin for helping pinpoint this issue during review of a workaround patch in !20194. Fixes GPU hangs in Elder Scrolls Online, Witcher 3, and likely more. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7639 Fixes: 9da56ffc522 ("i965/fs: add emit_shader_float_controls_execution_mode() and aux functions") Reviewed-by: Francisco Jerez <currojerez@riseup.net> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20214> (cherry picked from commit bafbe7c23a1cdd8c27ee5ea2da6b0575c53e2c5f)
-rw-r--r--.pick_status.json2
-rw-r--r--src/intel/compiler/brw_fs_visitor.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 6e6095cd912..a9dd9b86685 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2776,7 +2776,7 @@
"description": "intel/compiler: Set NoMask on cr0 access for float controls mode",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "9da56ffc5228ff4578d4a078e456a0bf8588e71c"
},
diff --git a/src/intel/compiler/brw_fs_visitor.cpp b/src/intel/compiler/brw_fs_visitor.cpp
index 8075076ece5..eb0e56c693f 100644
--- a/src/intel/compiler/brw_fs_visitor.cpp
+++ b/src/intel/compiler/brw_fs_visitor.cpp
@@ -269,7 +269,8 @@ fs_visitor::emit_shader_float_controls_execution_mode()
if (execution_mode == FLOAT_CONTROLS_DEFAULT_FLOAT_CONTROL_MODE)
return;
- fs_builder abld = bld.annotate("shader floats control execution mode");
+ fs_builder ubld = bld.exec_all().group(1, 0);
+ fs_builder abld = ubld.annotate("shader floats control execution mode");
unsigned mask, mode = brw_rnd_mode_from_nir(execution_mode, &mask);
if (mask == 0)