radv: fix determining the maximum number of waves that can use scratch
This estimation was incorrect, the number of waves doesn't only
depend of the number of VGPRs.
Though, {SPI,COMPUTE}_TMPRING_SIZE.WAVES should limit the number of
scratch waves in flight, not sure if limiting it really works.
This fixes a GPU hang with an upcoming game, and this might also
helps resolving some spurious random GPU hangs.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12700>
This commit is contained in:
committed by
Marge Bot
parent
ef7d840a70
commit
b31994cf67
@@ -254,7 +254,7 @@ radv_pipeline_init_scratch(const struct radv_device *device, struct radv_pipelin
|
||||
|
||||
max_stage_waves =
|
||||
MIN2(max_stage_waves, 4 * device->physical_device->rad_info.num_good_compute_units *
|
||||
(256 / pipeline->shaders[i]->config.num_vgprs));
|
||||
radv_get_max_waves(device, pipeline->shaders[i], i));
|
||||
max_waves = MAX2(max_waves, max_stage_waves);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1737,7 +1737,7 @@ radv_get_shader_name(struct radv_shader_info *info, gl_shader_stage stage)
|
||||
}
|
||||
|
||||
unsigned
|
||||
radv_get_max_waves(struct radv_device *device, struct radv_shader_variant *variant,
|
||||
radv_get_max_waves(const struct radv_device *device, struct radv_shader_variant *variant,
|
||||
gl_shader_stage stage)
|
||||
{
|
||||
struct radeon_info *info = &device->physical_device->rad_info;
|
||||
|
||||
@@ -470,7 +470,7 @@ struct radv_shader_variant *radv_create_trap_handler_shader(struct radv_device *
|
||||
|
||||
void radv_shader_variant_destroy(struct radv_device *device, struct radv_shader_variant *variant);
|
||||
|
||||
unsigned radv_get_max_waves(struct radv_device *device, struct radv_shader_variant *variant,
|
||||
unsigned radv_get_max_waves(const struct radv_device *device, struct radv_shader_variant *variant,
|
||||
gl_shader_stage stage);
|
||||
|
||||
const char *radv_get_shader_name(struct radv_shader_info *info, gl_shader_stage stage);
|
||||
|
||||
Reference in New Issue
Block a user