DXVK

From LinuxReviews
Jump to navigationJump to search
DXVK
The Windows-game "Monster Girl Island" running under WINE with DXVK for 3D rendering.
The Windows-game "Monster Girl Island" running under WINE with DXVK for 3D rendering.
Original author(s)Philip "doitsujin" Rebohle
Developer(s)Philip "doitsujin" Rebohle with a little help from Joshua-Ashton
Repositorygithub.com/doitsujin/dxvk
Exec wine.svg

DXVK is a DirectX 9, 10 and 11 to Vulkan translation layer for Wine. It performs a lot better than Wine's built-in DX9-11 translayer and it has better compatibility with games, scene demos and other graphical programs using DX9 to 11. It is something you definitively want to install if you run games and other graphical applications in Wine.

DXVK is written in C++. It is free software under the zlib License.

Performance[edit]

DXVK is a lot faster than the DX to OpenGL translation layer built into Wine. Wine's built-in translation layer will typically provide 70-80% of the performance DXVK offers. It is simply a more efficient translation layer using a more efficient graphics API.

How much faster DXVK will be will depend on the game, but it is generally a lot faster. Do note that it will only affect games using DX 9 to 11, it will not be used for applications using the DX12, OpenGL and Vulkan APIs directly.

UNIGINE Superposition, 1080p Medium, DirectX 11, Score:
UNIGINE Superposition, 1080p Medium, DirectX 11, average FPS:
FINAL FANTASY XIV: Stormblood benchmark, 1920x1080p High, overall score:

The FINAL FANTASY XIV: Stormblood benchmark does not only show that DXVK is faster, it also illustrates differences in compatibility. There are many visible rendering errors when Wine's built-in translation layer is used that are not when DXVK is enabled.

See Wine 6.3 Built-in vs DXVK 1.8: A Comparison Of Two Very Different DirectX Implementations for a comparison of several applications done in March 2021.

Verdict And Conclusion[edit]

DXVK makes Wine a lot better. It's that simple. The benchmarks we have done have revealed that:

  1. DXVK really is a lot faster, and
  2. it is also more compatible

There is simply no reason to use Wine's built in DX to OpenGL translation layer when DXVK exists - unless you are a purist who mind that DXVK is written in C++, not beautiful clean C like Wine and Wine's DX to OpenGL translation layer is. The underlying C code does not provide any performance-advantage in this case, so it isn't a worthwhile factor unless you are religious about those sorts of things.

Installation[edit]

There are packages for it available in the repositories of several Linux distributions.

Arch and Manjaro Linux users can install dxvk-bin fro AUR and manually enable it for their $WINEPREFIX directory by running a command like:

WINEPREFIX=$HOME/.wine setup_dxvk install

Fedora users can install it system-wide with dnf install wine-dxvk wine-dxvk-d3d9 . It is enabled automatically if those packages are installed.

It is also possible, and fairly easy, to install DXVK directly into a .wine folder. You will need to get a tarball from the DXVK releases page at github.com/doitsujin/dxvk/releases, extract it and run setup_dxvk.sh within with with install as an argument (./setup_dxvk.sh install) and that's it.

Installing from source[edit]

Snubbelrisk.jpg
Warning: Make sure you do NOT have any CFLAGS like CFLAGS="-O2 -pipe -march=native" set in your environment when you build DXVK. It builds 32-bit binaries in addition to 64-bit binaries. The DXVK build script doesn't strip CFLAGS away from the 32-bit compile and you will have problems if you compile the 32-bit DLL libraries with -march=native.

The dependencies will be biggest hurdle you will have if you want to install DXVK from source.

Those are Wine, meson, mingw-w64 and mingw-w32, mingw64-winpthreads and mingw32-winpthreads, and glslang.

Fedora users can install them with:

dnf -y install mingw-binutils-generic meson mingw64-gcc-c++ mingw32-gcc-c++ glslang mingw32-winpthreads mingw64-winpthreads mingw32-winpthreads-static mingw64-winpthreads-static

The clone the directory and enter it:

git clone https://github.com/doitsujin/dxvk.git
cd dxvk/

..and now comes the somewhat unusual part. DXVK is built by running a script called package-release.sh with the argument master followed by a folder and, optionally, --no-package. The script will create a subfolder named dxvk-master within the folder you specify.

You may want to build and install it in your .wine directory. It can, in that case, be built by running:

./package-release.sh master $HOME/.wine/ --no-package

A folder named $HOME/.wine/dxvk-master will be created if it builds successfully. That folder will contain a script called setup_dxvk.sh along with two folders: x32 and x64. You can enter that folder and run setup_dxvk.sh install to make Wine use your shiny new DXVK build.

The package-release.sh build script will complain that $HOME/.wine/dxvk-master exists if you update the source tree with git pull and run it again, so you will have to eradicate the target folder between compilations.

Heads-up Display[edit]

DXVK comes with it's own built-in heads up display. It can be used to show frame-count and other information on an overlay.

It can be enabled by setting the environment variable DXVK_HUD. It can be set to display an array of data including devinfo, fps, frametimes and more. See the dxvk github page for all. Setting DXVK_HUD=1 equals DXVK_HUD=devinfo,fps which displays GPU and driver version and framerate. Setting DXVK_HUD=full enables everything the HUD can show.

The HUD built into DXVK works fine, but it isn't as feature-rich as MangoHud or the Mesa built-in heads-up display for Vulkan.

See Also[edit]


avatar

Anonymous (cd8e711c)

8 months ago
Score 0
thank you for the benchmarks. i've been wondering myself how much of an improvement dxvk has over wine's opengl.
Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.