AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>
To: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>,
	"Roger He" <Hongbo.He-5C7GfCeVMHo@public.gmane.org>
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amd/amdgpu: set gtt size according to system memory size only
Date: Thu, 7 Dec 2017 19:07:33 +0100	[thread overview]
Message-ID: <7b138de2-70eb-62ef-e61a-8933d77af124@amd.com> (raw)
In-Reply-To: <090b426c-0635-3c59-8a69-315c7f430b59-otUistvHUpPR7s880joybQ@public.gmane.org>

Am 07.12.2017 um 18:34 schrieb Michel Dänzer:
> On 2017-11-29 10:12 AM, Roger He wrote:
>> Change-Id: Ib634375b90d875fe04a890fc82fb1e3b7112676a
>> Signed-off-by: Roger He <Hongbo.He@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++-----
>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index 17bf0ce..d0661907 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -1330,11 +1330,9 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
>>   		struct sysinfo si;
>>   
>>   		si_meminfo(&si);
>> -		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 = max(AMDGPU_DEFAULT_GTT_SIZE_MB << 20,
>> +			(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) {
>>
> I'm unable to finish a piglit run (using Mesa on Tonga in a Ryzen 7 1700
> system with 16 GB of RAM) with this change. Before, I had
>
>   [drm] amdgpu: 3072M of GTT memory ready.
>
> now it's
>
>   [drm] amdgpu: 10473M of GTT memory ready.
>
> While running piglit, there's lots of
>
>   [TTM] Out of kernel memory
>
> messages, followed by more badness, and eventually the machine becomes
> inaccessible via SSH and has to be hard rebooted.
>
>
> It occurred to me one thing not being taken into account here is that
> system memory is also needed for storing the contents of BOs evicted
> from VRAM. So I tried subtracting the VRAM size, resulting in
>
>   [drm] amdgpu: 8425M of GTT memory ready.
>
> but the problem still happened. So I tried 1/2 instead of 3/4 of RAM,
> resulting in
>
>   [drm] amdgpu: 6982M of GTT memory ready.
>
> and was able to finish a piglit run with that.

I think I know what is going on here. The max-texture-size keeps 
increasing the texture size as long as it doesn't fails to allocate one.

So the "Out of kernel memory" message is actually the desired effect 
(but we should probably remove the message).

The price question is what happens after that? Those code paths are 
probably not very well tested.

Christian.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-12-07 18:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29  9:12 [PATCH] drm/amd/amdgpu: set gtt size according to system memory size only Roger He
     [not found] ` <1511946723-27200-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org>
2017-11-29  9:34   ` Christian König
2017-12-07 17:34   ` Michel Dänzer
     [not found]     ` <090b426c-0635-3c59-8a69-315c7f430b59-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-12-07 18:07       ` Christian König [this message]
     [not found]         ` <7b138de2-70eb-62ef-e61a-8933d77af124-5C7GfCeVMHo@public.gmane.org>
2017-12-08 17:26           ` Michel Dänzer
     [not found]             ` <915d1570-856e-09ae-63b1-5e3d2b937edc-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-12-11  2:49               ` He, Roger
     [not found]                 ` <MWHPR1201MB0127DE9F4391624C09F625F1FD370-3iK1xFAIwjq9imrIu4W8xGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-12-11 11:29                   ` Michel Dänzer
     [not found]                     ` <8c70faa2-ee3e-296b-5c61-ede3ac6396f0-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-12-25  8:45                       ` He, Roger
     [not found]                         ` <MWHPR1201MB0127C74D1BFACE3F93B79640FD010-3iK1xFAIwjq9imrIu4W8xGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-12-27  8:58                           ` Michel Dänzer
     [not found]                             ` <ad59f224-9b6f-c5e3-a932-39a00d3d783f-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-12-28  3:37                               ` He, Roger
2018-01-02  9:57                             ` He, Roger
     [not found]                               ` <MWHPR1201MB012748089054D11868168EC0FD190-3iK1xFAIwjq9imrIu4W8xGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-01-03 16:32                                 ` Michel Dänzer
2017-12-08  1:52       ` He, Roger
  -- strict thread matches above, loose matches on Subject: below --
2017-11-28  9:40 Roger He
     [not found] ` <1511862059-14173-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org>
2017-11-28 10:00   ` Christian König
     [not found]     ` <7029b2bb-03be-6d74-578d-63fc48982b6e-5C7GfCeVMHo@public.gmane.org>
2017-11-29  2:40       ` He, Roger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b138de2-70eb-62ef-e61a-8933d77af124@amd.com \
    --to=christian.koenig-5c7gfcevmho@public.gmane.org \
    --cc=Hongbo.He-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=michel-otUistvHUpPR7s880joybQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox