diff options
| author | Samuel Zhang <[email protected]> | 2025-07-10 06:23:10 +0000 |
|---|---|---|
| committer | Mario Limonciello <[email protected]> | 2025-07-10 15:49:45 +0000 |
| commit | 924dda024f3bea64be5f3ac067a075e466739dc9 (patch) | |
| tree | 88729ff31a41049ba009acce063a2705e643d7b2 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
| parent | drm/ttm: add new api ttm_device_prepare_hibernation() (diff) | |
| download | kernel-924dda024f3bea64be5f3ac067a075e466739dc9.tar.gz kernel-924dda024f3bea64be5f3ac067a075e466739dc9.zip | |
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 <[email protected]>
Reviewed-by: Christian König <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mario Limonciello <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index d282c0753b14..723ab95d8c48 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -5029,8 +5029,16 @@ static int amdgpu_device_evict_resources(struct amdgpu_device *adev) return 0; ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM); - if (ret) + if (ret) { dev_warn(adev->dev, "evicting device resources failed\n"); + return ret; + } + + if (adev->in_s4) { + ret = ttm_device_prepare_hibernation(&adev->mman.bdev); + if (ret) + dev_err(adev->dev, "prepare hibernation failed, %d\n", ret); + } return ret; } |
