[PATCH] Revert "drm/amd/amdgpu: set gtt size according to system memory size only"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



________________________________
From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> on behalf of Andrey Grodzovsky <andrey.grodzovsky at amd.com>
Sent: Friday, December 15, 2017 2:09 PM
To: amd-gfx at lists.freedesktop.org
Cc: He, Roger; Daenzer, Michel; Koenig, Christian; Grodzovsky, Andrey
Subject: [PATCH] Revert "drm/amd/amdgpu: set gtt size according to system memory size only"

This reverts commit ba851eed895c76be0eb4260bdbeb7e26f9ccfaa2.
With that change piglit max size tests (running with -t max.*size) are causing
OOM and hard hang on my CZ with 1GB RAM.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky at amd.com>

Acked-by: Alex Deucher <alexander.deucher at amd.com>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index c307a7d..814a9c1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1329,9 +1329,11 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
                 struct sysinfo si;

                 si_meminfo(&si);
-               gtt_size = max(AMDGPU_DEFAULT_GTT_SIZE_MB << 20,
-                       (uint64_t)si.totalram * si.mem_unit * 3/4);
-       } else
+               gtt_size = min(max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),
+                              adev->mc.mc_vram_size),
+                              ((uint64_t)si.totalram * si.mem_unit * 3/4));
+       }
+       else
                 gtt_size = (uint64_t)amdgpu_gtt_size << 20;
         r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, gtt_size >> PAGE_SHIFT);
         if (r) {
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20171215/35af757a/attachment-0001.html>


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux