Skip to content

Commit f06446e

Browse files
mukjoshialexdeucher
authored andcommitted
drm/amdgpu: Fix VRAM memory accounting
Subtract the VRAM pinned memory when checking for available memory in amdgpu_amdkfd_reserve_mem_limit function since that memory is not available for use. Signed-off-by: Mukul Joshi <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e67572c commit f06446e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
220220
(kfd_mem_limit.ttm_mem_used + ttm_mem_needed >
221221
kfd_mem_limit.max_ttm_mem_limit) ||
222222
(adev && xcp_id >= 0 && adev->kfd.vram_used[xcp_id] + vram_needed >
223-
vram_size - reserved_for_pt)) {
223+
vram_size - reserved_for_pt - atomic64_read(&adev->vram_pin_size))) {
224224
ret = -ENOMEM;
225225
goto release;
226226
}

0 commit comments

Comments
 (0)