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

Feature Request: no VRAM access for game launchers #3356

Open
emansom opened this issue Apr 16, 2023 · 6 comments
Open

Feature Request: no VRAM access for game launchers #3356

emansom opened this issue Apr 16, 2023 · 6 comments

Comments

@emansom
Copy link

emansom commented Apr 16, 2023

Currently certain game launchers (Epic, Rockstar) eat up quite a lot of VRAM and this hurts gaming performance.

It'd be beneficial if DXVK didn't allow these apps to allocate any VRAM, as it would allow games to swap between BAR space less when VRAM usage is above a certain threshold.

Especially on low-end and mid-range GPUs this'd help a ton.

@doitsujin
Copy link
Owner

This sounds like a really gross band-aid for memory management problems on (current) NV drivers.

Reason why I don't like it is because a) there's nothing in a game launcher that tells us it's a game launcher, so we'd need to keep weird random app hacks around for every single one, and b) doing this is likely going to be highly problematic on systems with low PCI-E bandwidth (or high latency), e.g. external GPUs which already suffer quite badly with DXVK.

@Joshua-Ashton
Copy link
Collaborator

The Rockstar Launcher uses swiftshader anyway on Proton, doesn't it?

@Blisto91
Copy link
Contributor

Blisto91 commented Apr 17, 2023

Not that i can tell no.
But i think that is besides the original point anyway.

@mbriar
Copy link
Contributor

mbriar commented Apr 17, 2023

This sounds like a really gross band-aid for memory management problems on (current) NV drivers.

I don't know why you think it's only an issue on nvidia? VRAM spilling behavior on AMD is also catastrophically bad, especially on RADV since https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6833, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/8763 for some of the context.

The Rockstar Launcher uses swiftshader anyway on Proton, doesn't it?

Doesn't look like it's on the list: https://github.com/ValveSoftware/wine/blob/6f2e9039c530927b37c49e10a963af17ca36095d/dlls/kernelbase/process.c#L593

For what it's worth, you could kind of do your own workaround without any code changes by setting d3d9,dxgi,d3d11 to build-in in winecfg for only the launcher.exe, and then launching with LIBGL_ALWAYS_SOFTWARE=1 to use software rendering for any launchers using D3D or OpenGL. Nvidia might also need __GLX_VENDOR_LIBRARY_NAME set to something, can't say I've tested that.

@emansom
Copy link
Author

emansom commented Apr 17, 2023

For what it's worth, you could kind of do your own workaround without any code changes by setting d3d9,dxgi,d3d11 to build-in in winecfg for only the launcher.exe, and then launching with LIBGL_ALWAYS_SOFTWARE=1 to use software rendering for any launchers using D3D or OpenGL.

Great tip! Can't get this to work with Rockstar's Launcher though, it won't launch the game.

@Hadrianneue
Copy link

Hadrianneue commented Apr 18, 2023

@emansom wow dude you read my mind, i was just about to post this, this is already possible actually but with one caveat...

@doitsujin most launchers use OPENGL and LIBGL_ALWAYS_SOFTWARE=1 does prevent using VRAM, but as mentioned by OP Rockstar game launcher uses directx which brings us to DXVK_FILTER_DEVICE_NAME = llvmpipe

which works beautifully on red dead redemption 2, because you can run the game with Vulkan, however you can't do the same for GTA V since you be running the whole thing with llvmpipe.

So the obvious thing to do here is to just pass that environment variable to just the game launcher, i think that is possible with mesa workarounds, i'll try it right now, but since DXVK already provides a solution i guess WINE itself *could provide this option then?

EDIT: not possible on /usr/share/drirc.d/00-radv-defaults.conf or /usr/share/drirc.d/00-mesa-defaults.conf out of the box and adding more dri options to this effect would go out of the scope of mesa i would guess (though it would be nice to be able to set which device to use there with stuff like RADV_FORCE_FAMILY...)

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

No branches or pull requests

6 participants