From 3811834eb19855b1366c5d4abbedc3c98aebbeb9 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sat, 24 Sep 2022 21:09:32 +0200 Subject: [PATCH] rusticl: limit global mem to 2GB Signed-off-by: Karol Herbst Part-of: --- src/gallium/frontends/rusticl/core/device.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/rusticl/core/device.rs b/src/gallium/frontends/rusticl/core/device.rs index cea99856095..705eefbbd01 100644 --- a/src/gallium/frontends/rusticl/core/device.rs +++ b/src/gallium/frontends/rusticl/core/device.rs @@ -621,8 +621,12 @@ impl Device { } pub fn max_mem_alloc(&self) -> cl_ulong { - self.screen - .compute_param(pipe_compute_cap::PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE) + // TODO: at the moment gallium doesn't support bigger buffers + min( + self.screen + .compute_param(pipe_compute_cap::PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE), + 0x80000000, + ) } pub fn max_samplers(&self) -> cl_uint {