Mesa (staging/20.2): aco: Use program->num_waves as maximum in scheduler.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 11 17:40:47 UTC 2020


Module: Mesa
Branch: staging/20.2
Commit: 07562fcf663a1c870561d4705e4eb3db7f57923e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=07562fcf663a1c870561d4705e4eb3db7f57923e

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Thu Dec 10 18:54:43 2020 +0100

aco: Use program->num_waves as maximum in scheduler.

The scheduler doesn't take SGPR use into account, which can be
a limiting factor on older GPUs. This patch fixes a CTS test crash
on GFX6.

CC: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8040>
(cherry picked from commit 731f8fc9dd5018e9ee55982207b70130ab72d22b)

---

 .pick_status.json                  | 2 +-
 src/amd/compiler/aco_scheduler.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 94b0ba00805..1fef0a9ea28 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -49,7 +49,7 @@
         "description": "aco: Use program->num_waves as maximum in scheduler.",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp
index 9d6810672b5..6dae0b23860 100644
--- a/src/amd/compiler/aco_scheduler.cpp
+++ b/src/amd/compiler/aco_scheduler.cpp
@@ -910,9 +910,9 @@ void schedule_program(Program *program, live& live_vars)
    else
       ctx.num_waves = 7;
    ctx.num_waves = std::max<uint16_t>(ctx.num_waves, program->min_waves);
-   ctx.num_waves = std::min<uint16_t>(ctx.num_waves, program->max_waves);
+   ctx.num_waves = std::min<uint16_t>(ctx.num_waves, program->num_waves);
 
-   assert(ctx.num_waves > 0 && ctx.num_waves <= program->num_waves);
+   assert(ctx.num_waves > 0);
    ctx.mv.max_registers = { int16_t(get_addr_vgpr_from_waves(program, ctx.num_waves) - 2),
                             int16_t(get_addr_sgpr_from_waves(program, ctx.num_waves))};
 



More information about the mesa-commit mailing list