From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106872] vram sizes reported by the kernel totally off Date: Sat, 09 Jun 2018 22:47:28 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1293591593==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 144346E285 for ; Sat, 9 Jun 2018 22:47:28 +0000 (UTC) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1293591593== Content-Type: multipart/alternative; boundary="15285844470.0f0D29.19949" Content-Transfer-Encoding: 7bit --15285844470.0f0D29.19949 Date: Sat, 9 Jun 2018 22:47:27 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106872 Bug ID: 106872 Summary: vram sizes reported by the kernel totally off Product: DRI Version: unspecified Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: DRM/AMDgpu Assignee: dri-devel@lists.freedesktop.org Reporter: bas@basnieuwenhuizen.nl With Pierre-Loup's desktop we have an issue where the reported VRAM and CPU visible VRAM are totally off. e.g. the last report we had kernel reported total VRAM size of 0xfffffffb3070f000 (16.0 EiB) and a visible VRAM size of 0x86135000 (2.09 G= iB). The system is a large aperture system, so expected is ~8 GiB for both, and = it is most of the time. The system typically boots in a good state and eventua= lly after a while transitions to a bad state and sometimes it transitions back. We have not been able to find a pattern and on one of the earlier cases the debugfs vram_mm file reported reasonable size & utilization. The kernels that have been tried include amd-staging-drm-next and a released kernel (need to look up whether it was 4.15 or 4.16 if that information is needed) --=20 You are receiving this mail because: You are the assignee for the bug.= --15285844470.0f0D29.19949 Date: Sat, 9 Jun 2018 22:47:27 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated
Bug ID 106872
Summary vram sizes reported by the kernel totally off
Product DRI
Version unspecified
Hardware Other
OS All
Status NEW
Severity normal
Priority medium
Component DRM/AMDgpu
Assignee dri-devel@lists.freedesktop.org
Reporter bas@basnieuwenhuizen.nl

With Pierre-Loup's desktop we have an issue where the reported=
 VRAM and CPU
visible VRAM are totally off.

e.g. the last report we had kernel reported total VRAM size of
0xfffffffb3070f000 (16.0 EiB) and a visible VRAM size of 0x86135000 (2.09 G=
iB).

The system is a large aperture system, so expected is ~8 GiB for both, and =
it
is most of the time. The system typically boots in a good state and eventua=
lly
after a while transitions to a bad state and sometimes it transitions back.

We have not been able to find a pattern and on one of the earlier cases the
debugfs vram_mm file reported reasonable size & utilization.


The kernels that have been tried include amd-staging-drm-next and a released
kernel (need to look up whether it was 4.15 or 4.16 if that information is
needed)


You are receiving this mail because:
  • You are the assignee for the bug.
= --15285844470.0f0D29.19949-- --===============1293591593== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1293591593==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106872] vram sizes reported by the kernel totally off Date: Mon, 11 Jun 2018 17:15:34 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0770788434==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 147566E368 for ; Mon, 11 Jun 2018 17:15:34 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0770788434== Content-Type: multipart/alternative; boundary="15287373330.E7df2daa.32294" Content-Transfer-Encoding: 7bit --15287373330.E7df2daa.32294 Date: Mon, 11 Jun 2018 17:15:33 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106872 --- Comment #1 from Michel D=C3=A4nzer --- Please attach the dmesg output from the affected system, preferably captured while or after the problem occurs. (In reply to Bas Nieuwenhuizen from comment #0) > e.g. the last report we had kernel reported total VRAM size of > 0xfffffffb3070f000 (16.0 EiB) and a visible VRAM size of 0x86135000 (2.09 > GiB). Not the other way around? One potential issue I can see is that only BOs with AMDGPU_GEM_CREATE_NO_CPU_ACCESS are accounted for invisible_pin_size. But s= uch BOs can still end up pinned at least partially in CPU visible VRAM, which w= ould mess up the calculation of how much visible VRAM currently isn't pinned. One possible solution for this would be for amdgpu_bo_pin_restricted and amdgpu_bo_unpin to walk the list of memory nodes and calculate exactly how = much of each of them lies in visible or invisible VRAM. --=20 You are receiving this mail because: You are the assignee for the bug.= --15287373330.E7df2daa.32294 Date: Mon, 11 Jun 2018 17:15:33 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 1 on bug 10687= 2 from Michel D=C3=A4nzer
Please attach the dmesg output from the affected system, prefe=
rably captured
while or after the problem occurs.

(In reply to Bas Nieuwenhuizen from comment #0)
> e.g. the last report we had kernel reported tota=
l VRAM size of
> 0xfffffffb3070f000 (16.0 EiB) and a visible VRAM size of 0x86135000 (2=
.09
> GiB).

Not the other way around?

One potential issue I can see is that only BOs with
AMDGPU_GEM_CREATE_NO_CPU_ACCESS are accounted for invisible_pin_size. But s=
uch
BOs can still end up pinned at least partially in CPU visible VRAM, which w=
ould
mess up the calculation of how much visible VRAM currently isn't pinned.

One possible solution for this would be for amdgpu_bo_pin_restricted and
amdgpu_bo_unpin to walk the list of memory nodes and calculate exactly how =
much
of each of them lies in visible or invisible VRAM.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15287373330.E7df2daa.32294-- --===============0770788434== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0770788434==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106872] vram sizes reported by the kernel totally off Date: Tue, 12 Jun 2018 06:59:07 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0774331997==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 52C2789E65 for ; Tue, 12 Jun 2018 06:59:07 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0774331997== Content-Type: multipart/alternative; boundary="15287867470.cEfbc131a.12185" Content-Transfer-Encoding: 7bit --15287867470.cEfbc131a.12185 Date: Tue, 12 Jun 2018 06:59:07 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106872 --- Comment #2 from Christian K=C3=B6nig = --- (In reply to Michel D=C3=A4nzer from comment #1) > One possible solution for this would be for amdgpu_bo_pin_restricted and > amdgpu_bo_unpin to walk the list of memory nodes and calculate exactly how > much of each of them lies in visible or invisible VRAM. We actually have a helper for that in amdgpu_vram_mgr_vis_size(). Apart from that if the problem only occurse after a certain time it looks l= ike we have a mismatch between adding the pinned size and subtracting it again.= Or alternatively some sort of memory corruption. Have you tried running it with KASAN enabled for a while? --=20 You are receiving this mail because: You are the assignee for the bug.= --15287867470.cEfbc131a.12185 Date: Tue, 12 Jun 2018 06:59:07 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 2 on bug 10687= 2 from Christian K=C3= =B6nig
(In reply to Michel D=C3=A4nzer from comment #1)
> One possible solution for this would be for amdg=
pu_bo_pin_restricted and
> amdgpu_bo_unpin to walk the list of memory nodes and calculate exactly=
 how
> much of each of them lies in visible or invisible VRAM.

We actually have a helper for that in amdgpu_vram_mgr_vis_size().

Apart from that if the problem only occurse after a certain time it looks l=
ike
we have a mismatch between adding the pinned size and subtracting it again.=
 Or
alternatively some sort of memory corruption.

Have you tried running it with KASAN enabled for a while?


You are receiving this mail because:
  • You are the assignee for the bug.
= --15287867470.cEfbc131a.12185-- --===============0774331997== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0774331997==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106872] vram sizes reported by the kernel totally off Date: Thu, 14 Jun 2018 15:47:51 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2035945173==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id BB2E46E7FA for ; Thu, 14 Jun 2018 15:47:51 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============2035945173== Content-Type: multipart/alternative; boundary="15289912710.E94Df88.8044" Content-Transfer-Encoding: 7bit --15289912710.E94Df88.8044 Date: Thu, 14 Jun 2018 15:47:51 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106872 Michel D=C3=A4nzer changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|dri-devel@lists.freedesktop |michel@daenzer.net |.org | --- Comment #3 from Michel D=C3=A4nzer --- Created attachment 140160 --> https://bugs.freedesktop.org/attachment.cgi?id=3D140160&action=3Dedit drm/amdgpu: Refactor amdgpu_vram_mgr_bo_sizes helper --=20 You are receiving this mail because: You are the assignee for the bug.= --15289912710.E94Df88.8044 Date: Thu, 14 Jun 2018 15:47:51 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated = Michel D=C3=A4nzer changed bug 10687= 2
What Removed Added
Status NEW ASSIGNED
Assignee dri-devel@lists.freedesktop.org michel@daenzer.net

Commen= t # 3 on bug 10687= 2 from Michel D=C3=A4nzer
Created attachment 140160 [details] [review]
drm/amdgpu: Refactor amdgpu_vram_mgr_bo_sizes helper


You are receiving this mail because:
  • You are the assignee for the bug.
= --15289912710.E94Df88.8044-- --===============2035945173== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============2035945173==--