<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Well, it's not arguing. I'm just pointing out the problems.<br>
<br>
Those issues were discovered because I'm trying to raise the limit
for a couple of years now.<br>
<br>
I've also already hacked together the necessary functionality, but
upstreaming them has caused other issues which I don't have time to
solve.<br>
<br>
If you have time to tackle those, I'm happy to push the necessary
patches upstream.<br>
<br>
Regards,<br>
Christian.<br>
<br>
<div class="moz-cite-prefix">Am 20.05.22 um 23:36 schrieb Marek
Olšák:<br>
</div>
<blockquote type="cite"
cite="mid:CAAxE2A7opvBLs-VgfyNSSRRctmomZjM7y0C5s8FNuhR2V2Mt5w@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">We don't have to care about case 2 here. Broken
apps will be handled by app profiles. The problem is that some
games don't work with the current limit on the most powerful
consumer APU we've ever made (Rembrandt) with precisely the
games that the APU was made for, and instead of increasing the
limit, we continue arguing about some TTM stuff that doesn't
help anything right now.
<div dir="auto">
<div dir="auto"><br>
</div>
<div dir="auto">Marek</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri., May 20, 2022, 14:25
Christian König, <<a
href="mailto:ckoenig.leichtzumerken@gmail.com"
moz-do-not-send="true" class="moz-txt-link-freetext">ckoenig.leichtzumerken@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Am 20.05.22
um 19:41 schrieb Bas Nieuwenhuizen:<br>
> On Fri, May 20, 2022 at 11:42 AM Christian König<br>
> <<a href="mailto:ckoenig.leichtzumerken@gmail.com"
target="_blank" rel="noreferrer" moz-do-not-send="true"
class="moz-txt-link-freetext">ckoenig.leichtzumerken@gmail.com</a>>
wrote:<br>
>> In theory we should allow much more than that. The
problem is just that we can't.<br>
>><br>
>> We have the following issues:<br>
>> 1. For swapping out stuff we need to make sure that
we can allocate temporary pages.<br>
>> Because of this TTM has a fixed 50% limit where
it starts to unmap memory from GPUs.<br>
>> So currently even with a higher GTT limit you
can't actually use this.<br>
>><br>
>> 2. Apart from the test case of allocating textures
with increasing power of two until it fails we also have a
bunch of extremely stupid applications.<br>
>> E.g. stuff like looking at the amount of memory
available and trying preallocate everything.<br>
> I hear you but we also have an increasing number of games
that don't<br>
> even start with 3 GiB. At some point (which I'd speculate
has already<br>
> been reached, I've seen a number of complaints of games
that ran on<br>
> deck but not on desktop linux because on deck we set
amdgpu.gttsize)<br>
> we have more games broken due to the low limit than there
would be<br>
> apps broken due to a high limit.<br>
<br>
That's a really good argument, but the issue is that it is
fixable. It's <br>
just that nobody had time to look into all the issues.<br>
<br>
If started efforts to fix this years ago, but there was always
something <br>
more important going on.<br>
<br>
So we are left with the choice of breaking old applications or
new <br>
applications or getting somebody working on fixing this.<br>
<br>
Christian.<br>
<br>
><br>
>> I'm working on this for years, but there aren't easy
solutions to those issues. Felix has opted out for adding a
separate domain for KFD allocations, but sooner or later we
need to find a solution which works for everybody.<br>
>><br>
>> Christian.<br>
>><br>
>> Am 20.05.22 um 11:14 schrieb Marek Olšák:<br>
>><br>
>> Ignore the silly tests. We only need to make sure
games work. The current minimum requirement for running modern
games is 8GB of GPU memory. Soon it will be 12GB. APUs will
need to support that.<br>
>><br>
>> Marek<br>
>><br>
>> On Fri., May 20, 2022, 03:52 Christian König, <<a
href="mailto:ckoenig.leichtzumerken@gmail.com"
target="_blank" rel="noreferrer" moz-do-not-send="true"
class="moz-txt-link-freetext">ckoenig.leichtzumerken@gmail.com</a>>
wrote:<br>
>>> Am 19.05.22 um 16:34 schrieb Alex Deucher:<br>
>>>> The current somewhat strange logic is in
place because certain<br>
>>>> GL unit tests for large textures can cause
problems with the<br>
>>>> OOM killer since there is no way to link this
memory to a<br>
>>>> process. The problem is this limit is often
too low for many<br>
>>>> modern games on systems with more memory so
limit the logic to<br>
>>>> systems with less than 8GB of main memory.
For systems with 8<br>
>>>> or more GB of system memory, set the GTT size
to 3/4 of system<br>
>>>> memory.<br>
>>> It's unfortunately not only the unit tests, but
some games as well.<br>
>>><br>
>>> 3/4 of total system memory sounds reasonable to
be, but I'm 100% sure<br>
>>> that this will break some tests.<br>
>>><br>
>>> Christian.<br>
>>><br>
>>>> Signed-off-by: Alex Deucher <<a
href="mailto:alexander.deucher@amd.com" target="_blank"
rel="noreferrer" moz-do-not-send="true"
class="moz-txt-link-freetext">alexander.deucher@amd.com</a>><br>
>>>> ---<br>
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c |
25 ++++++++++++++++++++-----<br>
>>>> 1 file changed, 20 insertions(+), 5
deletions(-)<br>
>>>><br>
>>>> diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
>>>> index 4b9ee6e27f74..daa0babcf869 100644<br>
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
>>>> @@ -1801,15 +1801,30 @@ int
amdgpu_ttm_init(struct amdgpu_device *adev)<br>
>>>> /* Compute GTT size, either bsaed on
3/4th the size of RAM size<br>
>>>> * or whatever the user passed on
module init */<br>
>>>> if (amdgpu_gtt_size == -1) {<br>
>>>> + const u64 eight_GB = 8192ULL *
1024 * 1024;<br>
>>>> struct sysinfo si;<br>
>>>> + u64 total_memory,
default_gtt_size;<br>
>>>><br>
>>>> si_meminfo(&si);<br>
>>>> - gtt_size =
min(max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),<br>
>>>> -
adev->gmc.mc_vram_size),<br>
>>>> -
((uint64_t)si.totalram * si.mem_unit * 3/4));<br>
>>>> - }<br>
>>>> - else<br>
>>>> + total_memory = (u64)si.totalram
* si.mem_unit;<br>
>>>> + default_gtt_size = total_memory
* 3 / 4;<br>
>>>> + /* This somewhat strange logic
is in place because certain GL unit<br>
>>>> + * tests for large textures can
cause problems with the OOM killer<br>
>>>> + * since there is no way to
link this memory to a process.<br>
>>>> + * The problem is this limit is
often too low for many modern games<br>
>>>> + * on systems with more memory
so limit the logic to systems with<br>
>>>> + * less than 8GB of main
memory.<br>
>>>> + */<br>
>>>> + if (total_memory < eight_GB)
{<br>
>>>> + gtt_size =
min(max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),<br>
>>>> +
adev->gmc.mc_vram_size),<br>
>>>> +
default_gtt_size);<br>
>>>> + } else {<br>
>>>> + gtt_size =
default_gtt_size;<br>
>>>> + }<br>
>>>> + } else {<br>
>>>> gtt_size =
(uint64_t)amdgpu_gtt_size << 20;<br>
>>>> + }<br>
>>>><br>
>>>> /* Initialize GTT memory pool */<br>
>>>> r = amdgpu_gtt_mgr_init(adev,
gtt_size);<br>
<br>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>