-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Force wined3d if there's no Vulkan support #1749
Conversation
It's not clear if we want to do this, due to the user support fractal it implies. FWIW, you can specify PROTON_USE_WINED3D11 in the user_settings.py file so you don't have to do it for every game. |
@aeikum but it still means, that game does not work out of the box... I literally see no downsides here - it only improves the situation for some people so they don't need to investigate why "DirectX11 is not supported" on their Linux system? Non-technical people are more likely to request refund from Steam than look for workarounds... |
Same issue for me, I think @dreamer is doing the right thing here 👍 |
Rebased on top of 3.16-2 and adapted to use new proton environment variable. |
Can this check if a 32 bit instance can be created too? Sometimes people have Vulkan set up properly except they miss a 32 bit loader. |
@tannisroot can you show an example when it's a problem? I've never experienced it myself. @aeikum Seems like 3.16-4 included similar functionality - several games, that I tested that needed PROTON_USE_WINED3D now work out of the box (e.g. Tesla Effect (261510)). Did you implement this functionality by other means or just force-off dxvk for more titles in Steam compat database? [edit] nope, I just changed my user_settings.py to manually disable dxvk on this machine and forgot about it. In result, I made several wrong Platinum reports on protondb.com, because I thought no workarounds were required, damnit :/ |
looks good to me. |
e12b934
to
6dd508e
Compare
Rebased on top of 3.16-4 |
I don't think this is a very good idea, wined3d is much worse than the alternative, DXVK. Users should only attempt it as a very last resort, and should try to get their Vulkan setups working correctly instead. Also, if you have hardware that doesn't support Vulkan, you probably won't have have enough headroom to endure wined3d's awful performance. |
A prompt asking the user whether or not they want to use wine3d would probably make it more feasible. Easy access to information through steam whether or not vulkan support is possible/vulkan is installed correctly is another thing. |
@Guy1524 It's a fair point, I didn't think about users who have hardware capable of running Vulkan, but misconfigured system... although I don't think it applies here - steam runtime comes with it's own libvulkan.so and it's on user to have properly installed drivers (otherwise they won't be able to enjoy any game on Steam). This PR will (positively) affect users, whose hardware do not support DXVK. It's up to 15% of user base, as I mentioned earlier. Maybe blacklist of hardware ids would work better than querying vulkan, but I am not sure. Another way forward might be to implement this as opt-in to be configured through STEAM_COMPAT_CONFIG - it would be an optional switch to be decided per game title during whitelisting.
I don't agree at all - there are many non-demanding games, that work perfectly fine with wined3d3 even on older hardware. I wrote this patch with Gorogoa in mind, after seeing in forum users who bought the game to play using Proton, didn't know about proton env variables and requested a refund in result. I finished the game using wined3d and it worked just fine. @Iorce
I do not agree. If dxvk works, then there's no point in asking (just use dxvk). If it doesn't, then there's no point in asking (just use wined3d or let game report missing DX11 - current behaviour). And I leave information in log if fallback happened or not.
Yes :( This info is missing from Steam System Information. Also, vulkan detector that comes bundled with Steam ( |
@Guy1524: I don't think that is correct. I use wine3d3 to play games like Starcraft 2 as well as Final Fantasy X before I'd even tried dxvk. Plenty of older games work just fine with wined3d. I'm not a big gamer, so I just try to play what works in my 2013 Haswell based laptop with an nvidia mobile card. Bumblebee can't work with Vulkan and even the Intel card spews out info saying that Vulkan isn't complete for Haswell. Remeber that not all people who play games have the same needs as you. |
@Guy1524 to chime in here, I was honestly surprised this was an issue. My graphics card does not support vulkan on mesa (R9 270, I know 2013 but still it plays most modern games for now) and I couldn't get a single game to start, even if it was whitelisted! |
@Areiser Mesa does support Vulkan on your card, but requires the |
There's a fairly well made write up for using vulkan with early GCN cards at #813. |
I agree with dreamer! Same issue with multiple games. I think this can improve a lot satisfaction of gamers. There are people who just want to play. Some people will never go on github or make searches for solving the problem, they just want click and play. If the game starts when clicking "play", ok; but if it doesn't start, they will switch back to Windows (this happens for real, personal experience) XD |
I play a lot of retro and 2D games on my older intel laptop. It's never going to get Vulkan support and I have to configure the launch options for every single game. There's already a warning when running a game in proton for the first time, why not just add a blurb there about Vulkan too? I had to search around to find out about that environment variable and I'm not sure everyone would. So enabling it by default definitely helps a lot |
You don't have to set it for every game. You can set the variable globally by launching Steam with it already set, or add it to user_settings.py for each proton version. You'll also only need it for games that use d3d10 or d3d11. Older games that use d3d <=9 already use the GL backend. |
It still is something that should be automatic though? |
If the automatic wined3d switch is unfeasible (I'm not sure it should be automatic, tbh), at least add a warning message and a toggle somewhere in the UI that the game will launch without vulkan. I was trying to find out earlier why a game crashed upon launching (using default proton settings), and the error message in the log just said that it failed to create a d3d11 device - I had to turn on debug messages to see that it failed to load required vulkan extensions. Couldn't it really be an option in Steam Play settings? And if the vulkan drivers are missing, or your graphics card doesn't support vulkan, show an error/warning message if you try to enable dxvk support? |
I agree with this so much that I can't believe proton doesn't already do it. This needs to be added to the next milestone. |
@codeman101 I see one reason why this change might be unfeasible in its current state: users, who have not installed properly their drivers and are missing Vulkan support in the result. For these users, it might be better if the game fails, prompting them to investigate (and maybe leave clearly visible info in the logfile). However, I still see no reason why fallback to OpenGL shouldn't happen automatically for hardware, that definitely does not support Vulkan. I see two approaches here:
|
There's no need to keep a pciid list. |
Older systems without Vulkan support will fallback to using OpenGL based implementation by default. User can still force-enable dxvk with: PROTON_USE_WINED3D=0
@dreamer Regarding the GUI I know that's exactly why I mentioned using a console window instead. Regarding the API given what proton does (translating Windows calls to Linux) I'm a bit surprised that the API can't be detected. That's like saying I can translate language X to English but I can't tell if someone is speaking language X unless they tell me that they are. |
Wonder in which language they are gonna tell you which language they speak at all to begin with? 🤔 Just let knowledgeable people handle that. |
@codeman101 API can be detected at runtime. It cannot be reliably detected before the game starts, therefore there's no way to inform the user "to run this specific application you need Vulkan" and supress that message for applications, that don't need it. You could do some static binary analysis or suspend This PR is about detecting hardware that does not support Vulkan and gracefully falling back to OpenGL instead of letting the game fail because of no DirectX11 support. |
It doesn't sound like you understand the relationship I was making in the analogy.
Of course. As I said before I don't know how to do proton/wine coding specifically. I'm just stating what is common sense to me. Thanks for explaining that it's a runtime issue. That makes more sense. It's a shame but at least now I understand why it's hard to do. Wait if it can be detected at runtime why not have the popup appear when the user tries to press play?
I agree that it should do that fallback I was just trying to suggest a solution for letting the user know that they don't have vulkan installed. |
Game runtime, not Proton runtime. |
I would've figured the two types of runtime were more interlinked but if they're not hmmm. That's a good question. Well thanks for the explanation. If I think of a solution I'll post back. |
Again.. you just have to try opening |
@mirh I don't even need to create a device - I just use One way of addressing "user support fractal" concern would be to be more strict about falling back to OpenGL. ATM I decide to fallback when vulkan lib can't be loaded OR there are no physical devices. I plan to change it to vulkan lib can be loaded AND there are no physical devices - this way Proton won't automatically switch to OpenGL for users who just don't have drivers installed. |
For situations when user has Vulkan-capable hardware, but no libvulkan.so installed we prefer to NOT use OpenGL and let the game fail. We want Proton to fallback automatically only when we can verify there's no hardware support for Vulkan.
f211864
to
adc301d
Compare
Rebased to the latest version of
@aeikum I hope this version pushes PR towards merging. If you still consider this change undesirable, then I'll close it to avoid unnecesary discussion. |
Not really sure if it helps your discussion, but actually Vulkan absence is already detected at Steam runtime level, some assert in it's code being failed during Steam client startup. So, theoretically, Proton could be told that it's lacking Vulkan support via some environment variable, command-line option, etc. from Steam client itself. |
DXVK is the only supported renderer for d3d10 and d3d11. I think adding an automatic fallback to wined3d would mislead users into thinking it is a supported renderer. |
@thaewrapt I know. Before going ahead and implementing basic Vulkan handling using ctypes I've spent some time investigating if I can reuse some already existing mechanism. Binary in question is By nature of being closed source, I can't fix it. Also, this program uses some internal Steam API to communicate and there's no documentation available, so I would need to spend time reverse-engineering it, which I consider a wasted effort. Overall using Vulkan on such basic level straight from Python was not such a big deal - only ~110 lines of code :). |
@aeikum I see… I think most people consider it a user option and not a debug option. OK, so for people arriving at this PR at a later date: if you have the hardware that does not support Vulkan and are annoyed at putting
to your Officially, Proton supports only DXVK as DX10/11 renderer. I am closing this PR - if we'll ever need the code, it's still available in history or on my branch (https://github.com/dreamer/Proton/commits/po/vkquery). |
Stuff in |
@kisak-valve According to bash manual:
Freshly logged in to Fedora to make sure it works in purely GUI environment (maybe different distros override this behaviour somehow?). I stand by my comment ;) |
Currently there are users that are mislead into thinking proton/steam is just broken because the thing fails. |
It may be interesting to note that this was inaccurate when it was posted, and it's still somewhat inaccurate. Graphics Core Next 1 (HD 7730–7990, 8570–8990; RX 240–280, 330–370, 430–450, 520) only got Vulkan support added to Ubuntu LTS in January of 2020, when they accepted Mesa version 20 with the RADV backend. And Ubuntu LTS releases still don't ship with functioning AMDGPU drivers for Graphics Core Next 1–3 cards out-of-the-box; users have to twiddle around with someone could very well have a somewhat recent GPU and still get hit by this due to Canonical being slow to enable upstream graphics driver updates. |
Because I got annoyed by pasting PROTON_USE_WINED3D11=1 for every game on my old Thinkpad X220...
Implementation queries if system supports any Vulkan physical devices. If vulkan library can be loaded and there is at least one physical device available, then proceed as normal - otherwise inject PROTON_USE_WINED3D11 variable to prevent dxvk from reporting no DirectX11 support at all.
According to https://store.steampowered.com/hwsurvey?platform=linux ~13-15% of Linux Steam users still do not have hardware support for Vulkan API (Intel Sandy Bridge or older, NVIDIA GTX 5xx series or older and AMD Radeon HD 76xx or older). Those systems are quite old, but often capable of running e.g. most Unity games.
Fixes e.g. Gorogoa (557600) #1711, Tesla Effect: A Tex Murphy Adventure (261510), and probably any other Unity title using only D3D11 renderer.
In future it could be expanded to filter devices providing incomplete or broken Vulkan support (and e.g. either report warnings in log or forcing wine3d311) to mitigate issues like broken fonts in #791.