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

Koenig, Christian Christian.Koenig at amd.com
Fri Dec 29 20:19:06 UTC 2017


The difference is that the OOM killer doesn't know of the pages an application allocates through the driver.

This results in a bad decision which process to kill.

I had patches to fix this a long time ago on the list, but never found time to clean them up and push them upstream.

Andrey is now working on this, but I don't know the status of hand.

Christian.

Am 29.12.2017 20:36 schrieb "Kuehling, Felix" <Felix.Kuehling at amd.com>:
Is it possible that the test is broken? A test that allocates memory to
exhaustion may well trigger the OOM killer. A test can do that by using
malloc. Why not by using the graphics driver? The OOM killer does what
it's supposed to do, and kills the broken application.

As I understand it, this change is adds artificial limitations to
workaround a bug in a user mode test. However, it ends up limiting the
memory available for well behaved applications, more than necessary.

For compute applications that work with huge data sets, we want to be
able to allocate lots of system memory. Tying available system memory to
the VRAM size makes no sense for compute applications that want to work
with such huge data sets.

Regards,
  Felix


On 2017-12-15 02:09 PM, Andrey Grodzovsky wrote:
> 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>
> ---
>  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) {


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20171229/f2de26a4/attachment-0001.html>


More information about the amd-gfx mailing list