-
Notifications
You must be signed in to change notification settings - Fork 443
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
Regression on M1 GPUs #1482
Comments
As mentioned in the commit comments, those two commits were important in fixing how synchronization works between Vulkan submits on MoltenVK. Specifically, using There were a large number of CTS tests failing until that change, because Is there an understanding of why these |
@billhollings this happens with using DXVK-macOS and it affects different titles differently. The Witcher3 for example will lockup when your hit showing the message “GPU Lost” FF14 crashes shortly after launching of using MoltenVK-v1.1.5/v1.1.6, downgrading back to MoltenVK-v1.1.4 or reverting the mention commits the title works again. If you can provide any environment exports or debug options to use to help figure this out I’ll provide the output. But lightly the beat person for this would be @cdavis5e as there much more familiar with DXVK used with MoltenVK (hopefully CX21.1 lands shortly so there free) |
The type of Metal sync (
A little bit more documentation on these settings can be found in |
The async patch? https://github.com/Sporif/dxvk-async ? There are reports of this on nvidia also https://forums.developer.nvidia.com/t/vk-error-device-lost-in-many-game-titles/164513/2 This post in particular seems important. Workaround on dxvk |
My question more pertained to obtaining useful output to help someone figure this out, but I’m leaning towards forcing what seems to be required behavior for only Apple Silicon systems like how NVidia GPUs are handled.
Having async patch added doesn’t resolve the issue only downgrading back to MoltenVK-v1.1.4 (for FF14) or MoltenVK-v1.1.3 (for Witcher 3). CrossOver-21/PortingKit(Wineskin) are all using DXVK-macOS-1.7, there’s a more recent DXVK-macOS-1.9.2 and a separate async patches version. Not sure I’d want to venture down the rabbit hole of how terrible the Linux NVidia GPU drivers are as the issue my seem similar but might not be related. |
This https://developer.apple.com/forums/thread/685187 references MoltenVK.
Reading some Apple documentation and discussions on forums left me a bit confused about that. MTLFence detailed behavior? - https://developer.apple.com/forums/thread/108416?answerId=334883022#334883022 |
Did a bit more experimentation with the environment variables listed above... setting the following in my Crossover environment lets stock MVK 1.1.6 (without my patches) start properly on M1 without the "GPU Lost" errors:
|
I don’t see any Rosetta2 handling within MoltenVK and from the only mention of this the stance was Apple needs to handle these things. So the question now is how to ensure that |
Here's a clean solution that works for my use case;
|
Can you repeat this experiment with both settings disabled, and report the results, please:
This will cause MoltenVK to use CPU emulation, rather than |
@billhollings I’ve tested both of the mentioned scenarios and cpu emulation caused some screen tearing, where MTLFences didn’t. |
Thanks for the experiment. It's a valid step...but if this is a Rosetta issue, we will only want to select this if we are running on Rosetta. That is, MoltenVK built for x86, but running on an M1, by including some kind of If we are running an iOS build, or an M1 build natively (not Rosetta), we will want to allow As I mentioned above. the changes in 8c7db31 and 8e6731f dramatically improved CTS sync test results on all GPU's, including M1, so we need to permit native M1 and any iOS SoC's to use Once @FleetAdmiralButter responds to the results of my request above, I'll create a MoltenVK PR that deals with these various combinations. |
Uggh. Is that even with |
I agree the patch I've applied really isn't correct due to other devices using Apple GPUs but for the short-term it can work my usage case (wine64 + DXVK) as it's a very minimal chance making it better for quickly rebasing against master. I was more thinking of adding a check within MoltenVK/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm Lines 1383 to 1448 in c376273
As MoltenVK currently lacks a way to check if running under Rosetta2 I'd decided to go with the minimal change possible to make rebasing simpler.
When set to |
@billhollings, what are the possible implications of falling back to CPU emulation so I know what to look out for? Would it be lower performance or graphical artefacts? I believe Gcenx mentioned experiencing screen tearing in their post. I'm currently at work so I'll try this out later in the evening. |
@billhollings, just tried running the game again with CPU sync emulation. I did not notice any graphical artefacts, but there was a massive drop in performance. Scenes that usually ran close to 60FPS dropped down to as low as 30-40FPS. Setting MVK_ALLOW_METAL_FENCES back to 1 and restarting the application resolved the performance drop. Here are some screenshots - I'm standing around a hub area in Gridania with a number of players on-screen: |
Is that even with CPU sync requires a round trip back to the CPU to signal a |
I've just completed some extensive testing using the CTS On all GPU's, The CTS tests are aimed at consistency and accuracy, and not performance, so they won't cover things like the screen tearing and FPS. Based on all this, given the issues above with Rosetta2 implementations, I think the best path forward is to modify MoltenVK so that we use Platforms that have demonstrated issues with On these platforms, apps that prefer to prioritize performance and screen tearing over accuracy and consistency, will be able to opt to use |
@billhollings thank you for genuinely looking into this. For upstream that’s defiantly the beat course of action, downstream projects can always change from the default behavior as needed. |
Hey @billhollings @Gcenx, Apologies - I haven't had the chance to look at this in a couple days. Thanks for taking the time to test this out further - since this looks like a driver issue when running under Rosetta, would it be worth reporting to Apple? |
PR #1425 fixes this as described above. Please retest and indicate whether this fixes your issue. |
@billhollings the proposed fix does indeed fix the issue. |
Thanks. Closing this now. |
Hi there,
There's been an issue with the 1.1.5 and 1.1.6 releases of MoltenVK on Apple GPUs - namely a "GPU Lost" error causes apps using these versions of the library to crash. This problem is not present on versions 1.1.4 and below.
Here are some logs of the errors that get generated (they're quite long so I've put it in a Pastebin) - https://pastebin.com/8R78V4FY.
I pulled the MoltenVK repositories locally and managed to narrow down the commits that caused this regression:
8c7db31
8e6731f
Reverting these commits from the v1.1.6 tag and recompiling resulted in the errors above going away completely.
A diff is available here as reference: Kegworks-App#1.
The text was updated successfully, but these errors were encountered: