From c5c76a35864627b87d7d95289238333535fc1751 Mon Sep 17 00:00:00 2001 From: jsg Date: Sat, 15 Jun 2024 03:47:56 +0000 Subject: [PATCH] drm/amdgpu: Fix VRAM memory accounting From Mukul Joshi 422f3259ac6508e7289232fd7cb915914a527c70 in linux-6.6.y/6.6.33 f06446ef23216090d1ee8ede1a7d7ae430c22dcc in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index 6044d3fc845..6bbd18cb7c1 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -213,7 +213,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev, (kfd_mem_limit.ttm_mem_used + ttm_mem_needed > kfd_mem_limit.max_ttm_mem_limit) || (adev && xcp_id >= 0 && adev->kfd.vram_used[xcp_id] + vram_needed > - vram_size - reserved_for_pt)) { + vram_size - reserved_for_pt - atomic64_read(&adev->vram_pin_size))) { ret = -ENOMEM; goto release; } -- 2.20.1