Mesa (master): intel/compiler: Restrict cs_threads to 64

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 28 23:11:05 UTC 2020


Module: Mesa
Branch: master
Commit: cf12faef614ab7cd9996410f1d161558a3853936
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf12faef614ab7cd9996410f1d161558a3853936

Author: Jordan Justen <jordan.l.justen at intel.com>
Date:   Thu Oct 24 11:55:23 2019 -0700

intel/compiler: Restrict cs_threads to 64

Our current GPGPU_WALKER code only supports up to 64 threads.

On HSW we could use up to 70 and TGL up to 112, but only if the walker
is adjusted so the width does not exceed 64. Work to support this is
in progress.

Previous to this change, we might try to downgrade to SIMD8 if the
SIMD16 shader spilled. Since HSW and TGL have the max number of
threads above 64, we would then try to emit an invalid GPGPU walker
command.

Fixes: 932045061b5 ("i965/cs: Emit compute shader code and upload programs")
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni at intel.com>

---

 src/intel/compiler/brw_fs.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index 07963ef6490..10a73251a44 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -8841,8 +8841,10 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data,
       src_shader->info.cs.local_size[0] * src_shader->info.cs.local_size[1] *
       src_shader->info.cs.local_size[2];
 
+   /* Limit max_threads to 64 for the GPGPU_WALKER command */
+   const uint32_t max_threads = MIN2(64, compiler->devinfo->max_cs_threads);
    unsigned min_dispatch_width =
-      DIV_ROUND_UP(local_workgroup_size, compiler->devinfo->max_cs_threads);
+      DIV_ROUND_UP(local_workgroup_size, max_threads);
    min_dispatch_width = MAX2(8, min_dispatch_width);
    min_dispatch_width = util_next_power_of_two(min_dispatch_width);
    assert(min_dispatch_width <= 32);



More information about the mesa-commit mailing list