Skip to contentSkip to conversation

Radeonsi: High GTT usage in Prison Architect large map

Bug 88227 [email protected] 1 participant 14 messages Jan 9, 2015 – Jan 20, 2015

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=88227

Bug ID: 88227
Summary: Radeonsi: High GTT usage in Prison Architect large map
Product: DRI
Version: DRI git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: DRM/Radeon
Assignee: [email protected]
Reporter: [email protected]

Created attachment 111992
--> https://bugs.freedesktop.org/attachment.cgi?id=111992&action=edit
dmesg

Poor performace in Prison Architect (version alpha-28) when trying to play on the large map setting. Small map is smooth, Gallium hud showing 60fps. A new game with a large map (empty, nothing constructed) has about 0fps and high GTT usage while zoomed out. Zooming in fairly close on the large map shows a decrease in GTT use and fps increases.

Kernel is linux-3.19.0-rc3
Running git versions of the following packages (updated Jan 08):
libdrm 566c3ce877a4be72697e15cdfc421ce965f7c37d
llvm c41acffe2297585ad56aa772de75e82c132070bb xf86-video-ati 04da199231bb3f11cf17f94574a8df05855a7b82 mesa 3d8188d4f898afcf4f181de29e12c5b218bbd393

dmesg shows two errors:

[ 5665.586842] [drm:radeon_cs_ioctl [radeon]] *ERROR* Failed to parse
relocation -12!
[ 5750.747498] [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA

(-512)

R600_DEBUG=cs shows:
radeon: The kernel rejected CS, see dmesg for more information. R600_DEBUG=nodma seemed to have no effect.

Logs and gallium hud screenshots attached. Just picked up this game, so not sure if there is a regression involved. Will try some older kernels and mesa.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #1 from James Harvey <[email protected]> --- Created attachment 111993
--> https://bugs.freedesktop.org/attachment.cgi?id=111993&action=edit
xorg.log

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #2 from James Harvey <[email protected]> --- Created attachment 111994
--> https://bugs.freedesktop.org/attachment.cgi?id=111994&action=edit
Game log with R600_DEBUG=cs

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #3 from James Harvey <[email protected]> --- Created attachment 111995
--> https://bugs.freedesktop.org/attachment.cgi?id=111995&action=edit
Gallium hud on small map

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #4 from James Harvey <[email protected]> --- Created attachment 111996
--> https://bugs.freedesktop.org/attachment.cgi?id=111996&action=edit
Gallium hud on large map

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

Michel Dänzer <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

 Attachment #111996|text/plain                  |image/png
          mime type|                            |
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #6 from James Harvey <[email protected]> --- Unfortunately, it did not help.
Seems like the fps drops occurs whenever the requested GTT gets above about 515-520mb or so.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #7 from James Harvey <[email protected]> --- Further testing shows large fps drops from 60 to ~0 whenever used GTT exceeds 550mb. Tested kernels going back to 3.10.63 with no improvement.

Installed kernel 3.19.0-rc3 and llvm-3.4.2 to test mesa releases.

Confirmed this is a regression in mesa. Mesa-10.0.4, 10.3.5 and 10.3.6 manage at least 30fps or higher with GTT usage over 550mb.

Tested Mesa 10.4.1 and Mesa git master, both are effected by this issue. Looks like it was introduced in the 10.4 branch. Attempting to bisect.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

author Reviewed-by Marek Olšák
#9 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #8 from James Harvey <[email protected]> --- Created attachment 112085
--> https://bugs.freedesktop.org/attachment.cgi?id=112085&action=edit
large map prior to commit 150ac07b

Bisect complete:

150ac07b855b5c5f879bf6ce9ca421ccd1a6c938 is the first bad commit commit 150ac07b855b5c5f879bf6ce9ca421ccd1a6c938

Author: Michel Dänzer <[email protected]>
Date:   Wed Jun 25 18:36:43 2014 +0900

r600g/radeonsi: Prefer VRAM for CPU -> GPU streaming buffers

Prior to this commit, there is a slight fps drop (60->24) while moving around the map for the first time, but thereafter it stays at roughly 60fps.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #9 from James Harvey <[email protected]> --- Reverting the above commit against mesa git master did not solve the problem. Performed another bisection and got result:

commit b419c651fbbf3660d7b53623dfa2e5a4c9bd3b98

Author: Marek Olšák <[email protected]>
Date:   Wed Aug 20 23:53:40 2014 +0200

gallium/pb_bufmgr_cache: limit the size of cache

This should make a machine which is running piglit more responsive at
times.
e.g. streaming-texture-leak can easily eat 600 MB because of how fast it creates new textures.

Reverting this commit (to remove the cache limit) returned the game to full performance. Tested against git-ff1948a.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #10 from Marek Olšák <[email protected]> ---
James, can you increase the size of cache manually and see what works better? There is only one formula in radeon_drm_winsys.c:676, so it should be trivial.

Also please how much VRAM and GTT do you have?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

--- Comment #11 from James Harvey <[email protected]> --- Hello Marek,

My memory info:

[    1.879493] [drm] radeon: 2048M of VRAM memory ready
[    1.879494] [drm] radeon: 2048M of GTT memory ready.

I also have 8gb of system memory. I patched radeon_drm_winsys.c as per your suggestion. This seemed to work well:

- (ws->info.vram_size + ws->info.gart_size) / 8);
+ (ws->info.vram_size + ws->info.gart_size) / 2);

I tried changing the divisor to 4, but that didn't help much. Divisor at 3 was better but still had some fps drops to zero and trouble getting above about 40fps.
Divisor at 2 was much better, fps drops only when waiting for data to load in memory. (such as suddenly zooming out or saving/loading game).

While testing, the maximum GTT usage I saw was 1.82gb, with typical usage around 1-1.5gb depending on how closely the map was zoomed in. Vram usage is pretty flat, usually around 450mb.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=88227

Michel Dänzer <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Michel Dänzer <[email protected]> ---
Module: Mesa
Branch: master
Commit: ccc5b60b06269a5d847b7fe9ebe08dc61b4d2030 URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ccc5b60b06269a5d847b7fe9ebe08dc61b4d2030

Author: Marek Olšák <[email protected]>
Date:   Mon Jan 12 14:35:24 2015 +0100

winsys/radeon: increase the size of buffer cache

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel