From becccebd21b4fff4eb69daed7b9280dd7a7f0ad3 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Sat, 23 Aug 2025 20:11:01 +0200 Subject: [PATCH] nvk: Use MEM_LOCAL for nvk_cmd_mem_create It is safe to allocate command buffer memory as MEM_LOCAL (VRAM or GART) when we can map GPU memory (we trust NVKMD to force GART). This reduces latency on pyrowave for compute dispatch (~1.90ms -> ~1.48ms), likely as QMD and the root tables should not have been in GART in the first place. Signed-off-by: Mary Guillemard Part-of: --- src/nouveau/vulkan/nvk_cmd_pool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nouveau/vulkan/nvk_cmd_pool.c b/src/nouveau/vulkan/nvk_cmd_pool.c index c652c520861..1751fededd4 100644 --- a/src/nouveau/vulkan/nvk_cmd_pool.c +++ b/src/nouveau/vulkan/nvk_cmd_pool.c @@ -21,9 +21,9 @@ nvk_cmd_mem_create(struct nvk_cmd_pool *pool, bool force_gart, struct nvk_cmd_me if (mem == NULL) return vk_error(pool, VK_ERROR_OUT_OF_HOST_MEMORY); - uint32_t flags = NVKMD_MEM_GART; - if (force_gart) - assert(flags & NVKMD_MEM_GART); + const uint32_t flags = force_gart ? NVKMD_MEM_GART + : NVKMD_MEM_LOCAL; + result = nvkmd_dev_alloc_mapped_mem(dev->nvkmd, &pool->vk.base, NVK_CMD_MEM_SIZE, 0, flags, NVKMD_MEM_MAP_WR,