Skip to content

Commit 924dda0

Browse files
guoqzhansuperm1
authored andcommitted
drm/amdgpu: move GTT to shmem after eviction for hibernation
When hibernate with data center dGPUs, huge number of VRAM BOs evicted to GTT and takes too much system memory. This will cause hibernation fail due to insufficient memory for creating the hibernation image. Move GTT BOs to shmem in KMD, then shmem to swap disk in kernel hibernation code to make room for hibernation image. Signed-off-by: Samuel Zhang <guoqing.zhang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://lore.kernel.org/r/20250710062313.3226149-3-guoqing.zhang@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent 40b6a94 commit 924dda0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5029,8 +5029,16 @@ static int amdgpu_device_evict_resources(struct amdgpu_device *adev)
50295029
return 0;
50305030

50315031
ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
5032-
if (ret)
5032+
if (ret) {
50335033
dev_warn(adev->dev, "evicting device resources failed\n");
5034+
return ret;
5035+
}
5036+
5037+
if (adev->in_s4) {
5038+
ret = ttm_device_prepare_hibernation(&adev->mman.bdev);
5039+
if (ret)
5040+
dev_err(adev->dev, "prepare hibernation failed, %d\n", ret);
5041+
}
50345042
return ret;
50355043
}
50365044

0 commit comments

Comments
 (0)