[Mesa-dev] [PATCH] radeonsi: Bugfix needed for hashcat

Nicolai Hähnle nhaehnle at gmail.com
Thu Dec 22 16:07:36 UTC 2016


On 19.12.2016 23:26, Christian Inci wrote:
> Hashcat needs MAX_GLOBAL_BUFFERS to be 21 or even 22 for some modes. It'll crash otherwise.
> I'm adding an assert to see if programs need it to be even higher.
>
> Signed-off-by: Christian Inci <chris.bugsfd at broke-the-inter.net>

I'm not too familiar with OpenCL, but shouldn't there be some 
propagation of the number of bindings to the caller and appropriate 
error handling? Or is the number of bindings supposed to be adjusted 
dynamically based on application need?

Either way, this can only serve as a temporary fix. The real bug is 
still out there somewhere else.


> ---
>  src/gallium/drivers/radeonsi/si_compute.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
> index 9d83cb3a..9bad34ed 100644
> --- a/src/gallium/drivers/radeonsi/si_compute.c
> +++ b/src/gallium/drivers/radeonsi/si_compute.c
> @@ -32,7 +32,7 @@
>  #include "si_pipe.h"
>  #include "sid.h"
>
> -#define MAX_GLOBAL_BUFFERS 20
> +#define MAX_GLOBAL_BUFFERS 22
>
>  struct si_compute {
>  	unsigned ir_type;
> @@ -195,6 +195,7 @@ static void si_set_global_binding(
>  	unsigned i;
>  	struct si_context *sctx = (struct si_context*)ctx;
>  	struct si_compute *program = sctx->cs_shader_state.program;
> +	assert(n <= MAX_GLOBAL_BUFFERS);

This should check for first + n. I'm going to change this before pushing.

Nicolai

>
>  	if (!resources) {
>  		for (i = first; i < first + n; i++) {
>


More information about the mesa-dev mailing list