Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable pinned memory for AMD mesa drivers #4973

Merged
merged 1 commit into from Mar 14, 2017
Merged

Disable pinned memory for AMD mesa drivers #4973

merged 1 commit into from Mar 14, 2017

Conversation

ghost
Copy link

@ghost ghost commented Feb 26, 2017

Very sorry for multiple PRs I'm not good with git. I'm almost sure this is correct this time though.

Pinned memory causes a massive performance drop on my system using mesa with AMD cards.

@0x647262
Copy link
Contributor

Which card(s) exhibit regressions when using pinned memory?

I assume it affects all games?

@ghost
Copy link
Author

ghost commented Feb 26, 2017

RX460 and an older 6850 card.

It effects some games more than others, Smash Bros Melee for example doesn't have it nearly as bad as some other games, but yes I believe it's all games. Sonic Adventure 2's opening cutscene was something I used to test it with, where the difference is huge.

Basically unplayable with it enabled, about 10-20fps in 60fps games, and without it enabled getting 60fps with no framedrops.

Using mesa built from git (happens with older versions), and Linux 4.10.0

@ds84182
Copy link
Contributor

ds84182 commented Feb 26, 2017

After updating to the latest mesa I went from 30-60fps in Kirby Air Ride City Trial to almost full 60fps at all times.

@stenzek
Copy link
Contributor

stenzek commented Feb 27, 2017

@ds84182 Is that with or without this PR?

I'm wondering if it's worth introducing a different driverdetails bug for this, as the BROKEN_PINNED_MEMORY bug refers to broken index buffers, not performance issues with both vertex and index buffers (which appears to be the case here?).

@ghost
Copy link
Author

ghost commented Feb 27, 2017

Feel free to edit whatever you want or just make your own commit and close this. I don't care about any recognition.

I would just like something to be done because this has been quite a severe bug effecting me for a year now. I just didn't know what was causing the severely bad performance on my system until now. I worry that there's a lot of other users with complaints about bad performance on Linux with AMD cards who actually just need to disable pinned memory, but don't know it. You would never find out because they're just posting in forums or bug trackers with vague complaints about bad performance, and receiving tips/advice to improve performance that won't work.

@stenzek
Copy link
Contributor

stenzek commented Feb 27, 2017

@z0z0z I think like you may be overstating the impact of this bug, if it is just restricted to users Mesa/AMDGPU with Polaris GPUs, and I hadn't seen any reports of performance issues prior to this (although I don't watch the forum).

I'm still wondering whether it's worth dropping the pinned memory case completely, as this patch disables it completely for the binary blob on Linux, as well as Mesa, only leaving Windows blob users (where D3D and Vulkan performance is better anyway).

If the percentage of Windows/AMD/GL users is high enough (and that comment about buffer storage being slow still holds true), LGTM.

@JMC47
Copy link
Contributor

JMC47 commented Feb 27, 2017

I'm fine with trying this out to see what happens. What's the worst that happens? We have to revert it due to some other gfx card not liking it? Or coming up with another more specific disable?

@ghost
Copy link
Author

ghost commented Feb 27, 2017

if it is just restricted to users Mesa/AMDGPU with Polaris GPUs

It also happened with older GPUs using the older radeon DRM driver. Yes I know this OS/GPU/Driver combo is much less common than someone using Windows/Nvidia, but it is still a severe bug for anyone experiencing this.

I hadn't seen any reports of performance issues prior to this

Relatively not too many users are using Linux with AMD open-source drivers, I imagine the ones that have ran into this problem just don't say anything because there's basically no point in complaining about performance if you don't already know specifically what is wrong, or have made a vague performance complaint and never found out what was causing bad performance. Like perhaps this guy:

https://forums.dolphin-emu.org/Thread-anyway-to-increase-performance-under-linux?highlight=linux

Sunshine is one of the better games with this bug though. Other games are much worse, like Twilight Princess where you will get a much more severe impact.

@ghost
Copy link
Author

ghost commented Feb 27, 2017

Here is a video of the difference I'm getting with and without pinned memory enabled. Dolphin settings are at 3x IR, 4x MSAA, x16 anisotropic filtering.

https://a.pomf.cat/kvgovn.mp4

@mirh
Copy link

mirh commented Mar 2, 2017

You might want to try to ask on #mesa too.

@mirh
Copy link

mirh commented Mar 9, 2017

@z0z0z Marek is waiting for an answer on freedesktop

@degasus degasus merged commit 31bb41c into dolphin-emu:master Mar 14, 2017
@degasus
Copy link
Member

degasus commented Mar 14, 2017

In my opinion, the pinned memory extension here is mostly legacy code. It was written before ARB_buffer_storage was specified. As mesa always supports buffer_storage, we should just use the better one. IIRC pinned memory is just used on Windows to avoid handling with the client and coherent flag of buffer_storage.

@mirh
Copy link

mirh commented Mar 7, 2018

Pinned memory might have been fixed with https://github.com/mesa3d/mesa/commit/b52721e3b693e113aa537d163c8a855169e7b75d

In other news, intel is looking into adding this too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants