Bug 104193 - [radeonsi] The Witcher 3 freezes the system with no attachments calls & transform feedback Wine patch
Summary: [radeonsi] The Witcher 3 freezes the system with no attachments calls & trans...
Status: NEW
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-10 14:28 UTC by Shmerl
Modified: 2018-01-28 19:21 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
The Witcher 3: rotfiends radeonsi freeze (883.97 KB, application/x-xz)
2017-12-10 14:28 UTC, Shmerl
Details
GALLIUM_DDEBUG dumps during the GPU freeze (41.13 KB, application/x-xz)
2018-01-28 19:21 UTC, Shmerl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shmerl 2017-12-10 14:28:25 UTC
Created attachment 136068 [details]
The Witcher 3: rotfiends radeonsi freeze

Wine has an issue with distorted monsters in The Witcher 3. Józef Kucia identified the problem as follows:

* wined3d doesn't support draw calls with no attachments,
* wined3d tries to map transform feedback buffers while transform feedback is paused.

See https://bugs.winehq.org/show_bug.cgi?id=43872#c8

He provided a patch: https://bugs.winehq.org/attachment.cgi?id=59848&action=diff&context=patch&collapsed=&headers=1&format=raw

However applying it, is causing a system freeze (with radeonsi) after such kind of monsters are encountered in the game and fighting them for some time. See attached savegame for example with rotfiends.

Interestingly, Józef Kucia couldn't reproduce this freeze with radeon driver, so it appears to be radeonsi specific.

You can apply the above Wine patch to Wine git master to test it (I build Wine using just that patch, and one staging patch for performance: 

https://raw.githubusercontent.com/wine-compholio/wine-staging/master/patches/wined3d-buffer_create/0001-wined3d-Do-not-pin-large-buffers.patch

My last test environment:

OpenGL renderer string: AMD Radeon (TM) RX 480 Graphics (POLARIS10 / DRM 3.18.0 / 4.13.0-1-amd64, LLVM 5.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.4.0-devel (git-b926da241a)
Comment 1 Shmerl 2017-12-21 15:42:09 UTC
Interestingly, this freeze seems to be Polaris specific. Users with Vega cards didn't manage to reproduce it. Same with older GCN 1.0 cards such as R9 M375 using amdgpu.ko.

So can it be a bug in amdgpu itself then?
Comment 2 Shmerl 2017-12-24 00:29:47 UTC
A correction, apparently Vega users are still getting the freeze, but unlike the Polaris case, they are able to exit the game without the whole system hanging (may be because Vega supports GPU reset better).
Comment 3 Shmerl 2017-12-29 04:53:22 UTC
Tested it with Linux 4.15rc5 and new amdgpu.dc=1 (to enable new display code). The freeze still happens.
Comment 4 Shmerl 2018-01-28 19:21:55 UTC
Created attachment 137009 [details]
GALLIUM_DDEBUG dumps during the GPU freeze

I run TW3 with GALLIUM_DDEBUG=10000 (10 second delay for GPU hang detection). It detected the hang when it actually happened (I also had to build umr debugger from source, since Mesa complained otherwise that umr isn't found).

I attach produced dumps, please check if it helps identifying the issue. See also included debug.log for console output. Let me know if it can be run in some other way to get more information.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.