[Mesa-dev] [PATCH 1/4] radeonsi: correct maximum wave count per SIMD

Marek Olšák maraeo at gmail.com
Thu Aug 24 16:02:15 UTC 2017


On Thu, Aug 24, 2017 at 3:24 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> On 24.08.2017 13:32, Marek Olšák wrote:
>>
>>
>>
>> On Aug 24, 2017 1:21 PM, "Nicolai Hähnle" <nhaehnle at gmail.com
>> <mailto:nhaehnle at gmail.com>> wrote:
>>
>>     On 24.08.2017 12 <tel:24.08.2017%2012>:34, Marek Olšák wrote:
>>
>>
>>
>>         On Aug 24, 2017 10:17 AM, "Nicolai Hähnle" <nhaehnle at gmail.com
>>         <mailto:nhaehnle at gmail.com> <mailto:nhaehnle at gmail.com
>>         <mailto:nhaehnle at gmail.com>>> wrote:
>>
>>              On 23.08.2017 22:44, Marek Olšák wrote:
>>
>>                  From: Marek Olšák <marek.olsak at amd.com
>>         <mailto:marek.olsak at amd.com> <mailto:marek.olsak at amd.com
>>
>>         <mailto:marek.olsak at amd.com>>>
>>
>>
>>                  ---
>>                     src/gallium/drivers/radeonsi/si_shader.c | 17
>>         ++++++++++++++++-
>>                     1 file changed, 16 insertions(+), 1 deletion(-)
>>
>>                  diff --git a/src/gallium/drivers/radeonsi/si_shader.c
>>                  b/src/gallium/drivers/radeonsi/si_shader.c
>>                  index f02fc9e..186a3dd 100644
>>                  --- a/src/gallium/drivers/radeonsi/si_shader.c
>>                  +++ b/src/gallium/drivers/radeonsi/si_shader.c
>>                  @@ -5029,21 +5029,36 @@ static void
>>         si_shader_dump_stats(struct
>>                  si_screen *sscreen,
>>                                                    struct
>>         pipe_debug_callback *debug,
>>                                                    unsigned processor,
>>                                                    FILE *file,
>>                                                    bool
>> check_debug_option)
>>                     {
>>                           const struct si_shader_config *conf =
>>         &shader->config;
>>                           unsigned num_inputs = shader->selector ?
>>                  shader->selector->info.num_inputs : 0;
>>                           unsigned code_size =
>>         si_get_shader_binary_size(shader);
>>                           unsigned lds_increment = sscreen->b.chip_class
>>          >= CIK ?
>>                  512 : 256;
>>                           unsigned lds_per_wave = 0;
>>                  -       unsigned max_simd_waves = 10;
>>                  +       unsigned max_simd_waves;
>>                  +
>>                  +       switch (sscreen->b.family) {
>>                  +       /* SGPR initialization bug workaround on Tonga
>> and
>>                  Iceland reduces
>>                  +        * the wave count to 8. */
>>                  +       case CHIP_TONGA:
>>                  +       case CHIP_ICELAND:
>>                  +       /* These always have 8 waves: */
>>                  +       case CHIP_POLARIS10:
>>                  +       case CHIP_POLARIS11:
>>                  +       case CHIP_POLARIS12:
>>                  +               max_simd_waves = 8;
>>
>>
>>              This should be implied by the num_sgprs set by LLVM, though.
>>
>>
>>         I have no idea what you mean or why it's relevant.
>>
>>
>>     There's this code later in the function:
>>
>>              if (conf->num_sgprs) {
>>                      if (sscreen->b.chip_class >= VI)
>>                              max_simd_waves = MIN2(max_simd_waves, 800 /
>>     conf->num_sgprs);
>>                      else
>>                              max_simd_waves = MIN2(max_simd_waves, 512 /
>>     conf->num_sgprs);
>>              }
>>
>>
>> Yes, but that's alright. Why is it important? num_sgprs is always nonzero.
>
>
> It means that the SGPR initialization bug part of the change is redundant.
> LLVM sets the num_sgprs in such a way that the calculation
>
>   max_simd_waves = MIN2(max_simd_waves, 800 / conf->num_sgprs);
>
> will set max_simd_waves to 8.

Ah yes, that's true.

Marek


More information about the mesa-dev mailing list