How to Use DXVK with Games: A Guide to Boosting Performance and Compatibility

How to Use DXVK with Games: A Guide to Boosting Performance and Compatibility

 https://i.ytimg.com/vi/8YmRTsWWVT0/maxresdefault.jpg

A few years ago, the idea of playing modern DirectX 11 or DirectX 12 games seamlessly on Linux was largely a dream. Performance was often subpar, and compatibility issues were rampant. Enter DXVK, a groundbreaking open-source project that has revolutionized gaming on Linux and offered niche uses on Windows. If you're looking to enhance your gaming experience, especially outside of a native Windows environment, understanding DXVK is a game-changer.

Key Takeaway: DXVK is a translation layer that converts DirectX 9, 10, and 11 API calls to Vulkan API calls. It's crucial for improving performance and compatibility of Windows games on Linux via Wine/Proton, and can offer specific benefits for some Windows setups. This guide provides step-by-step instructions for installation and use.


What is DXVK? A Bridge to Better Performance

At its core, DXVK is a translation layer. It takes DirectX 9, 10, and 11 API (Application Programming Interface) calls, which are fundamental instructions games use to communicate with your graphics card, and translates them into Vulkan API calls. Why is this significant?

Vulkan is a modern, low-overhead graphics API that offers closer-to-the-metal control over your GPU, often leading to better performance and efficiency, especially on Linux. Traditionally, running Windows-native DirectX games on Linux via compatibility layers like Wine involved translating DirectX to OpenGL, which could introduce performance bottlenecks. DXVK bypasses this by translating directly to Vulkan, leveraging its power.

---

Why Should You Use DXVK?

While DXVK's primary benefits shine on Linux, it has applications for various users:

  • Superior Performance on Linux: For gamers running Windows titles through Wine or Proton (Steam Play) on Linux, DXVK often delivers significantly better frame rates and smoother gameplay compared to Wine's built-in DirectX to OpenGL translation.
  • Enhanced Compatibility: Many games that previously suffered from graphical glitches, crashes, or outright refusal to run on Wine become perfectly playable with DXVK enabled. It significantly broadens your gaming library on Linux.
  • Leveraging Modern Hardware: DXVK taps into the efficiency of the Vulkan API, allowing your modern GPU to perform optimally, even when running older DirectX titles. This includes access to features like Asynchronous Shader Compilation, which can reduce stuttering.
  • Niche Use on Windows: While less common, some Windows users might experiment with DXVK for specific edge cases, like debugging, or to address rare compatibility issues where a game might perform better through the Vulkan layer than native DirectX, though performance benefits are not guaranteed.
---

How to Get Started with DXVK: A Step-by-Step Guide

Prerequisites

Before you begin, ensure your system meets these basic requirements:

  • Vulkan Compatible GPU and Drivers: You need a graphics card that supports Vulkan (most modern AMD, Nvidia, and Intel GPUs do) and up-to-date drivers for it.
  • Target Game: DXVK works with games that utilize DirectX 9, DirectX 10, or DirectX 11. It does not replace DirectX 12, though some games may use a mix.
  • For Linux Users: Ensure you have Wine installed (for standalone games) or are using Steam Play (Proton).

Step 1: Download DXVK

The first step is to get the latest DXVK release.

  • Navigate to the official DXVK GitHub releases page.
  • Download the archive named something like dxvk-x.y.z.tar.gz or dxvk-x.y.z.zip (where x.y.z is the version number).

Step 2: Extract the Files

Once downloaded, extract the archive. Inside, you'll typically find folders named x32 and x64. These contain the necessary DLL files for 32-bit and 64-bit applications, respectively.

  • Inside x32, you'll find d3d9.dll, d3d10core.dll, d3d10_1.dll, d3d11.dll, and dxgi.dll.
  • Inside x64, you'll find the 64-bit versions of the same DLLs.

Step 3: Installation Method

Option A: Manual Installation for Individual Games (Windows & Linux with Wine)

This method is straightforward and involves placing the DXVK files directly into the game's directory.

  1. Locate the Game's Executable: Find the folder where the game's main executable (.exe file) is located. This is usually where the game installs.
  2. Copy the DLLs:
    • If the game is 64-bit, copy all the DLL files from the x64 folder of your DXVK download into the game's executable directory.
    • If the game is 32-bit, copy all the DLL files from the x32 folder into the game's executable directory.
    • Important: Most modern games are 64-bit. If unsure, check the game's system requirements or simply try the 64-bit DLLs first. If it doesn't work, try 32-bit.
  3. Launch the Game: Simply run the game as you normally would. DXVK should now be active.

Option B: For Linux Users with Wine (Prefix-wide Installation)

This method installs DXVK into a specific Wine prefix, making it available for all games within that prefix.

  1. Open Terminal: Navigate to the extracted DXVK folder in your terminal.
  2. Run Setup Script: Use the provided setup script. Replace /path/to/your/wine/prefix with the actual path to your game's Wine prefix (e.g., ~/.wine for the default prefix).
    WINEPREFIX=/path/to/your/wine/prefix ./setup_dxvk.sh
    This script will copy the correct DLLs and register them within the Wine prefix.
  3. Alternatively, for simpler management, consider using tools like Winetricks, which often has a DXVK installation option within its GUI for specific prefixes.

Option C: For Linux Users with Steam Play (Proton)

If you're using Steam Play (Proton), good news! DXVK is already integrated into Proton and enabled by default for nearly all games. You typically don't need to do anything.

  • Default Behavior: For most games, simply installing and launching them via Steam Play will automatically use DXVK.
  • Custom Proton Versions (e.g., Proton GloriousEggroll - GE): If you're using a custom Proton build, DXVK is still bundled. You usually just select the Proton GE version in the game's compatibility settings.
  • Troubleshooting/Advanced: In rare cases, if you need to force a specific DXVK version or disable it (e.g., for debugging), you can often do so via game-specific launch options in Steam (e.g., adding `PROTON_USE_DXVK=0 %command%` to disable it).
---

Verifying DXVK and Advanced Configuration

Once installed, you can verify if DXVK is active. Many games, when running with DXVK, will display a small heads-up display (HUD) in the top-left corner showing frame rate, GPU usage, and "DXVK" or "Vulkan." You can enable this by setting the environment variable DXVK_HUD=1 before launching the game (for Wine, e.g., DXVK_HUD=1 wine /path/to/game.exe).

For more advanced users, DXVK allows for per-game configuration via a dxvk.conf file placed in the game's executable directory. This file can be used to tweak settings like asynchronous shader compilation (dxvk.enableAsync=true), control logging, or manage other specific behaviors to optimize performance or compatibility.

---

Troubleshooting Tips

  • Update Drivers: Ensure your graphics drivers are always up to date and fully support Vulkan. This is the most common fix for issues.
  • Check Game Compatibility: Not all games work perfectly with DXVK, though most do. Check online communities (e.g., ProtonDB for Steam Play users) for specific game reports.
  • Revert Changes: If a game performs worse or crashes with DXVK, simply remove the copied DLLs from its directory (or disable DXVK in your Wine/Proton settings) to revert to default behavior.
  • Log Files: DXVK generates log files (e.g., game.log) in the game's directory when there are issues. These can provide valuable clues for debugging.
---

A Powerful Tool for PC Gaming

DXVK stands as a testament to the power of open-source development and its ability to solve complex technical challenges. By bridging the gap between DirectX and Vulkan, it has not only unlocked a vast library of games for Linux users but also pushed the boundaries of what's possible in compatibility layers. Whether you're a Linux gamer seeking peak performance or simply curious about pushing your system's capabilities, mastering DXVK is a powerful tool in your PC gaming arsenal.