DLSSTweaks icon indicating copy to clipboard operation
DLSSTweaks copied to clipboard

Assistance with documenting the use of DLSS Tweaks with Windows games on Linux

Open Treemcgee324 opened this issue 2 years ago • 1 comments

DLSS Super Resolution for Windows games works on Linux through translation layers. And DLSS Tweaks works too. But in some cases some extra work is required to get DLSS Tweaks working. And I wanted to help provide documentation on how to do this.

I just haven't done a pull request before, and I'm not even sure where to put the Linux documentation. So I thought I could maybe share the information here and maybe @emoose or someone else could add it to the documentation?


I should start by explaining how Windows games on Linux works, why DLSS Tweaks sometimes doesn't work, and some terminology so if you're not familiar with Windows games on Linux, you can still hopefully understand the documentation.

On Linux, there are a set of translation layers. The most common ones being WINE, DXVK, and VKD3D. WINE handles all the CPU side translations that need to occur to get Windows builtin functions working on Linux. DXVK, VKD3D do the graphics API translations.

This combination of translation layers and other tools are can be bundled together by other people for you to use (E.G. Proton provided by Valve) or you can make your own combinations. And since most/all these translations layers are open source, modifications can be made by different people/companies to suit their needs. And this adds some complexity to the instructions on how to get DLSS Tweaks working on Linux, hence why there are multiple sections explaining how to get DLSS Tweaks working.

Now, why doesn't DLSS Tweaks work out of the box on Linux? Because WINE ignores some dll files unless they are explicitly called by an application. And some of those dll files are the names that DLSS Tweaks dll needs to be renamed too to work. So we need to open winecfg (A WINE configuration tool) and tell WINE to try loading the DLSS Tweaks dll instead of ignoring it. And this fixes the issue.


Terminology that may be useful

  • "Proton" is the name given to a custom build of WINE + DXVK + VKD3D + other stuff made by Valve for use in the "Steam Play" program/initiative. It is distributed through Steam on Linux.

  • "Lutris" is a GUI app that allows for easy management of all this WINE + addons thing for applications that aren't installed through Steam (Lutris exists because it can be cumbersome setting up and configuring a WINE installation for gaming. And Proton can behave a bit weirdly when launched from outside Steam due to certain modifications made by Valve).

  • A "wineprefix" is a folder thatstores all the useful information for the fake Windows environment that WINE uses. Most/all the user configurable stuff for WINE goes in there. You install an app with WINE, it automatically tries installing it to a C drive, which is a folder located inside the wineprefix. That app puts files in the AppData folder, it goes in a AppData folder inside a "user" folder in the wineprefix. You make a Windows registry edit in "WINE", that change gets saved to a file in the wineprefix. You configure which Windows version WINE should report itself as, that setting gets saved to the WINE prefix. I hope you get the idea. A wineprefix holds most/all the user configurable data relevant to your fake Windows environment. Also, you can have multiple wineprefix. For example, Steam's Proton creates a wineprefix for every Windows game installed.

  • "WineTricks" is an GUI application to help do some regular tasks inside a wineprefix.

  • "ProtonTricks" is WineTricks, but with extra features to make it easier to work on games installed through Steam and run with Proton.


Here are the steps for getting DLSS Tweaks working on Linux:

  1. Setup your translation layers, install the game, and setup environment variables to enable DLSS in your DLSS supported game, and test it. (Check a different guide for this, the complexity and exact instructions change depending on certain factors)
  2. Install DLSS Tweaks in the game directory, just like Windows. In some cases this works, in others it doesn't. For example, it doesn't work in Red Dead Redemption 2 where the dll needs to be renamed to XInput9_1_0.dll. If DLSS Tweaks doesn't work, then you will need to consult one of the guides from below.

Steam - Proton

This guide is for games you installed through Steam and are running with Proton.

  1. Install ProtonTricks.
  2. Open the ProtonTricks GUI
  3. Select the game you're having issues with (For me, Red Dead Redemption 2)
  4. Select the option Select the default wineprefix
  5. Select the option Run winecfg
  6. In the window that pops up, go to the Libraries tab.
  7. In the New override for library section select or type in the name of the DLSSTweaks DLL and press Add
  8. In the Existing overrides find the DLL you added, select Edit and ensure it's set to Native then Builtin (This step is probably unnecessary as it seems to be the default for new items)
  9. Finally Apply the changes, close the window and ProtonTricks, and run the game. It should hopefully work.

Here is a short video demonstrating the process:

https://user-images.githubusercontent.com/50531537/220551488-da38cf20-38f2-4d77-9428-eb77c2b21194.mp4

Lutris

This is games you installed through Lutris with WINE and are using Lutris to continue maintaining it.

  1. Open Lutris
  2. Select your application.
  3. At the bottom of the Lutris UI, click on the upward arrow beside the WINE glass and select Wine configuration
  4. Do steps 6-9 from the Steam - Proton section.

Here is a short video demonstrating the process:

https://user-images.githubusercontent.com/50531537/220552857-fea078d1-10ef-426b-8a22-c041f20dcd74.mp4

Standalone WINE - Option 1

This if for if you are using a standalone build of WINE with nothing special to manage it.

  1. Run winecfg in a terminal.
  2. Do steps 6-9 from the Steam - Proton section.

Standalone WINE - Option 2

This if for if you are using a standalone build of WINE with nothing special to manage it.

  1. Install Winetricks.
  2. Open Winetricks.
  3. And do steps 4-9 from the Steam - Proton section.

There's no video since it looks almost identical to the ProtonTricks method due to ProtonTricks just being WineTricks but with extra tools to help with Proton games.

Generic

This is for all other services that use WINE as their backend for getting Windows games running on Linux.

  1. Find out where the wineprefix is for your game.
  2. Run winecfg on it, ensuring you use the WINE binary you use with that prefix to start winecfg.
  3. Do steps 6-9 from the Steam - Proton section.

Note: The order in which I presented each option was in order of most common to least common. This leads to a little bit of a weird layout. For example, Plain WINE - Option 1 should probably be at the top of the list as it's the simplest, every other method would reference it, and every other method is just a different way of getting too winecfg (where Plain WINE - Option 1 just opens winecfg directly). But I put Proton then Lutris at the top because those are way more common than using WINE without some kind of manager (Steam and Lutris are managers)

Note 2: Some guides are missing for other popular options. For example the "Heroic Launcher" (An open source tool that allow the installing and running of games from the Epic Games Store) or Bottles (This appears to be similar to Lutris)

Treemcgee324 avatar Feb 22 '23 07:02 Treemcgee324

Using dxgi.dll works. Thanks.

wsy2220 avatar Apr 15 '23 12:04 wsy2220