drm/amd/amdgpu: set gtt size according to system memory size only
Subsystems (2)
PATCH 1/1 drm/amd/amdgpu: set gtt size according to system memory size only
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3 -5
@@ -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) {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1511946723-27200-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org
Christian König
Reviewed-byAm 29.11.2017 um 10:12 schrieb Roger He:
Quoted 2 lines
Change-Id Ib634375b90d875fe04a890fc82fb1e3b7112676aSigned-off-by Roger He <[email protected]>
Quoted 13 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-1@@ -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),
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c int amdgpu_ttm_init(struct amdgpu_device *adev) · line 1338
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-4- 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) {
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 16 lines · Roger He
Change-Id Ib634375b90d875fe04a890fc82fb1e3b7112676aSigned-off-by Roger He <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-1@@ -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),
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c int amdgpu_ttm_init(struct amdgpu_device *adev) · line 1338
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-4- 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.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 090b426c-0635-3c59-8a69-315c7f430b59-otUistvHUpPR7s880joybQ@public.gmane.org
Am 07.12.2017 um 18:34 schrieb Michel Dänzer:
Quoted 48 lines · Roger He
Quoted 16 lines
Change-Id Ib634375b90d875fe04a890fc82fb1e3b7112676aSigned-off-by Roger He <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-1@@ -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),drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c int amdgpu_ttm_init(struct amdgpu_device *adev) · line 1338
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-4- 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
Quoted 8 lines
[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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 7b138de2-70eb-62ef-e61a-8933d77af124-5C7GfCeVMHo@public.gmane.org
Quoted 59 lines · Christian König
Am 07.12.2017 um 18:34 schrieb Michel Dänzer:
Quoted 49 lines · Roger He
Quoted 23 lines
Change-Id Ib634375b90d875fe04a890fc82fb1e3b7112676aSigned-off-by Roger He <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 8 +++-----1 file changed, 3 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-5@@ -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;Quoted 4 lines
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
Quoted 8 lines
[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.
Quoted 8 lines
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.
I'm attaching all the related dmesg output I've captured. Basically, best case is the OOM reaper killing piglit, worst case is no response to SSH => hard reboot.
Until this becomes more robust, this change should probably be reverted.
Quoted 3 lines · Roger
[TTM] Out of kernel memory
The direct reason is GTT BO swap out failure which results from more Bo allocation. And along with that need moreacc_size. But why swap out failure I am not sure that is expected here for this case, maybe need to investigate.
FWIW, though it's probably not directly related: This happens with the swap partition (8GB) completely unused.
Signature · 2 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 915d1570-856e-09ae-63b1-5e3d2b937edc-otUistvHUpPR7s880joybQ@public.gmane.org
-----Original Message-----
From: Michel Dänzer [mailto:[email protected]]
Sent: Saturday, December 09, 2017 1:26 AM
To: Koenig, Christian <[email protected]>; He, Roger <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: set gtt size according to system memory size only
Quoted 60 lines · Christian König
Am 07.12.2017 um 18:34 schrieb Michel Dänzer:
Quoted 50 lines · Roger He
Quoted 24 lines
Change-Id Ib634375b90d875fe04a890fc82fb1e3b7112676aSigned-off-by Roger He <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 8 +++-----1 file changed, 3 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-5@@ -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;Quoted 4 lines
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
Quoted 8 lines
[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.
Quoted 8 lines
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.
I'm attaching all the related dmesg output I've captured. Basically, best case is the OOM reaper killing piglit, worst case is no response to SSH => hard reboot.
Until this becomes more robust, this change should probably be reverted.
I have not got any valuable info from error log.
Please revert it now as quick solution, later let me check the reason.
Thanks
Roger(Hongbo.He)
Quoted 3 lines · Roger
[TTM] Out of kernel memory The direct reason is GTT
BO swap out failure which results from more Bo allocation. And along with that need moreacc_size. But why swap out failure I am not sure that is expected here for this case, maybe need to investigate.
FWIW, though it's probably not directly related: This happens with the swap partition (8GB) completely unused.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MWHPR1201MB0127DE9F4391624C09F625F1FD370-3iK1xFAIwjq9imrIu4W8xGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]
Quoted 10 lines · Roger
Quoted 10 lines
From: Michel Dänzer [mailto:[email protected]] On 2017-12-07 07:07
Quoted 8 lines · Christian König
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).
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
The price question is what happens after that? Those code paths are probably not very well tested.
I'm attaching all the related dmesg output I've captured. Basically, best case is the OOM reaper killing piglit, worst case is no response to SSH => hard reboot.
BTW, even when the machine stays responsive via SSH, the GPU hangs.
Quoted 5 lines
Quoted 2 lines
Until this becomes more robust, this change should probably be reverted.
I have not got any valuable info from error log. Please revert it now as quick solution, later let me check the reason.
I'm busy with other stuff, can you revert it?
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 8c70faa2-ee3e-296b-5c61-ede3ac6396f0-otUistvHUpPR7s880joybQ@public.gmane.org
-----Original Message-----
From: Michel Dänzer [mailto:[email protected]]
Sent: Monday, December 11, 2017 7:29 PM
To: He, Roger <[email protected]>; Koenig, Christian <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: set gtt size according to system memory size only
Quoted 10 lines · Roger
Quoted 10 lines
From: Michel Dänzer [mailto:[email protected]] On 2017-12-07 07:07
Quoted 8 lines · Christian König
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).
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
The price question is what happens after that? Those code paths are probably not very well tested.
I'm attaching all the related dmesg output I've captured. Basically, best case is the OOM reaper killing piglit, worst case is no response to SSH => hard reboot.
BTW, even when the machine stays responsive via SSH, the GPU hangs.
Quoted 5 lines
Quoted 2 lines
Until this becomes more robust, this change should probably be reverted.
I have not got any valuable info from error log. Please revert it now as quick solution, later let me check the reason.
I'm busy with other stuff, can you revert it?
Sorry for until now noticing your mail. And thanks Grodzovsky.Andrey for doing that.
Could you tell me how to duplicate this issue? Maybe now I can look into it.
Thanks
Roger(Hongbo.He)
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MWHPR1201MB0127C74D1BFACE3F93B79640FD010-3iK1xFAIwjq9imrIu4W8xGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]
Quoted 2 lines · Roger
Could you tell me how to duplicate this issue? Maybe now I can look into it.
It happened for me running
piglit run -x glx-multithread-texture --process-isolation false gpu results/gpu.<date>
using the Mesa radeonsi driver on Tonga in a Ryzen 7 1700 (8 cores, 16 threads) system with 16 GB of RAM.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): ad59f224-9b6f-c5e3-a932-39a00d3d783f-otUistvHUpPR7s880joybQ@public.gmane.org
Got it, thank you!
-----Original Message-----
From: Michel Dänzer [mailto:[email protected]]
Sent: Wednesday, December 27, 2017 4:58 PM
To: He, Roger <[email protected]>; Koenig, Christian <[email protected]>; Grodzovsky, Andrey <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: set gtt size according to system memory size only
Quoted 2 lines · Roger
Could you tell me how to duplicate this issue? Maybe now I can look into it.
It happened for me running
piglit run -x glx-multithread-texture --process-isolation false gpu results/gpu.<date>
using the Mesa radeonsi driver on Tonga in a Ryzen 7 1700 (8 cores, 16 threads) system with 16 GB of RAM.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
----Original Message-----
From: Michel Dänzer [mailto:[email protected]]
Sent: Wednesday, December 27, 2017 4:58 PM
To: He, Roger <[email protected]>; Koenig, Christian <[email protected]>; Grodzovsky, Andrey <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: set gtt size according to system memory size only
Quoted 2 lines · Roger
Could you tell me how to duplicate this issue? Maybe now I can look into it.
piglit run -x glx-multithread-texture --process-isolation false gpu results/gpu.<date>
on my side, not work with above command:
root@jenkins-MS-7984:/home/jenkins/roger/piglit.0902.release# ./piglit run -x glx-multithread-texture --process-isolation false gpu results/gpu
usage: piglit [-h] [-f CONFIG_FILE] [-n <test name>] [-d] [-t <regex>]
[-x <regex>] [-b {junit,json}] [-c | -1]
[-p {glx,x11_egl,wayland,gbm,mixed_glx_egl}] [--valgrind]
[--dmesg] [--abort-on-monitored-error] [-s]
[--junit_suffix JUNIT_SUFFIX] [--junit-subtests]
[-v | -l {quiet,verbose,dummy,http}] [--test-list TEST_LIST]
[-o] [--deqp-mustpass-list]
<Profile paths)> [<Profile path(s> ...] <Results Path>
piglit: error: unrecognized arguments: --process-isolationis it because my piglit is too old?
Or any other command can duplicate the failure as well?
Thanks
Roger(Hongbo.He)
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MWHPR1201MB012748089054D11868168EC0FD190-3iK1xFAIwjq9imrIu4W8xGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]
Quoted 27 lines · Roger
----Original Message-----
From: Michel Dänzer [mailto:[email protected]]
Sent: Wednesday, December 27, 2017 4:58 PM
To: He, Roger <[email protected]>; Koenig, Christian <[email protected]>; Grodzovsky, Andrey <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: set gtt size according to system memory size onlyQuoted 2 lines · Roger
Could you tell me how to duplicate this issue? Maybe now I can look into it.
piglit run -x glx-multithread-texture --process-isolation false gpu results/gpu.<date>on my side, not work with above command:
root@jenkins-MS-7984:/home/jenkins/roger/piglit.0902.release# ./piglit run -x glx-multithread-texture --process-isolation false gpu results/gpu usage: piglit [-h] [-f CONFIG_FILE] [-n <test name>] [-d] [-t <regex>] [-x <regex>] [-b {junit,json}] [-c | -1] [-p {glx,x11_egl,wayland,gbm,mixed_glx_egl}] [--valgrind] [--dmesg] [--abort-on-monitored-error] [-s] [--junit_suffix JUNIT_SUFFIX] [--junit-subtests] [-v | -l {quiet,verbose,dummy,http}] [--test-list TEST_LIST] [-o] [--deqp-mustpass-list] <Profile paths)> [<Profile path(s> ...] <Results Path> piglit: error: unrecognized arguments: --process-isolation
Quoted 1 line
is it because my piglit is too old?
Looks like it. Normally, one should always use current Git master of piglit. If you can't or don't want to do that, you can try with just
piglit run -x glx-multithread-texture gpu results/gpu.<date>
but it may be less likely to reproduce the issue.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[TTM] Out of kernel memory
The direct reason is GTT BO swap out failure which results from more Bo allocation. And along with that need more acc_size. But why swap out failure I am not sure that is expected here for this case, maybe need to investigate.
Thanks
Roger(Hongbo.He)
-----Original Message-----
From: Michel Dänzer [mailto:[email protected]]
Sent: Friday, December 08, 2017 1:34 AM
To: He, Roger <[email protected]>
Cc: [email protected]; Koenig, Christian <[email protected]>
Subject: Re: [PATCH] drm/amd/amdgpu: set gtt size according to system memory size only
Quoted 17 lines · Roger He
Change-Id Ib634375b90d875fe04a890fc82fb1e3b7112676aSigned-off-by Roger He <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-1@@ -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),
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c int amdgpu_ttm_init(struct amdgpu_device *adev) · line 1338
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-4- 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.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx