https://github.com/jesewe/install_dxvk
This Python CLI script automates the installation of DXVK.
https://github.com/jesewe/install_dxvk
d3d11 d3d9 dxvk gaming linux vulkan wine
Last synced: 19 days ago
JSON representation
This Python CLI script automates the installation of DXVK.
- Host: GitHub
- URL: https://github.com/jesewe/install_dxvk
- Owner: Jesewe
- License: mit
- Created: 2025-07-02T13:35:44.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-05T14:34:13.000Z (11 months ago)
- Last Synced: 2025-07-05T15:53:55.624Z (11 months ago)
- Topics: d3d11, d3d9, dxvk, gaming, linux, vulkan, wine
- Language: Python
- Homepage: https://github.com/Jesewe/install_dxvk
- Size: 2.34 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# DXVK Installation Script
## Overview
This Python CLI script automates the installation of [DXVK](https://github.com/doitsujin/dxvk), a Vulkan-based translation layer for Direct3D 8, 9, 10, and 11, into a specified game directory. It downloads the specified or latest DXVK release from GitHub and copies the required DLLs to the appropriate location (`system32` or `syswow64` subdirectories if they exist, or the game directory itself). The script supports both interactive prompts and command-line arguments, making it versatile for running Windows games on Linux with Wine or DXVK Native setups. It also includes auto-detection of the required DXVK version based on game executable dependencies.
## Installation
### Prerequisites
- Python 3.9+
- Required Python libraries (listed in `requirements.txt`)
### Steps
1. **Clone or Download the Script**:
- Clone this repository or download the `install_dxvk.py`, `dxvk_utils.py`, and `requirements.txt` files.
2. **Install Dependencies**:
```bash
pip install -r requirements.txt
```
3. **Run the Script**:
- **Interactive Mode**:
Execute the script without arguments to use interactive prompts:
```bash
python install_dxvk.py
```
Follow the prompts to specify:
- **Game Directory**: Enter the path to the game directory (e.g., `/home/user/games/MyGame`).
- **Bitness**: Choose `x32` or `x64` based on the game's architecture.
- **DXVK Version**: If not auto-detected, select the Direct3D version (1 for D3D8, 2 for D3D9, 3 for D3D10, 4 for D3D11).
- **Command-Line Mode**:
Run the script with arguments to skip prompts:
```bash
python install_dxvk.py --game-dir /path/to/game --bitness x64 --dxvk-version d3d11 --dxvk-release v2.3
```
Available arguments:
| Argument | Description |
|---|---|
| `--game-dir` | Path to the game directory (e.g., `/home/user/games/MyGame`). |
| `--bitness` | Game architecture: `x32` or `x64`. |
| `--dxvk-version` | DXVK version: `d3d8`, `d3d9`, `d3d10`, or `d3d11`. If omitted, auto-detection is attempted. |
| `--dxvk-release` | Specific DXVK release version (e.g., `v2.3`). If omitted, the latest release is used. |
| `--check-update` | Explicitly check for a newer version of the script. |
| `--no-update-check` | Skip the update check entirely (useful for automated/CI environments). |
4. **Post-Installation**:
- For **Wine**: Use `winecfg` to add native DLL overrides for the installed DLLs (e.g., `d3d9`, `d3d11`, `dxgi`).
- For **DXVK Native**: Ensure the game loads DLLs from the installed location and set the `DXVK_WSI_DRIVER` environment variable (e.g., `export DXVK_WSI_DRIVER=SDL2`).
- Verify DXVK usage by setting:
```bash
export DXVK_HUD=1
```
Then run the game to check if DXVK is active.
## Features
- **Flexible Input**: Supports both interactive prompts and command-line arguments for game directory, bitness, DXVK version, and specific release version.
- **Specific Version Installation**: Allows installation of a specific DXVK release (e.g., `v2.2`) using the `--dxvk-release` argument.
- **Auto-Detection of DXVK Version**: Automatically detects the required DXVK version by analyzing `.exe` files in the game directory using the `pefile` library. Detection uses numeric version priority to correctly resolve cases where a game imports DLLs from multiple Direct3D generations (e.g., a game importing both `d3d9.dll` and `d3d10core.dll` is correctly identified as D3D10).
- **Existing Version Detection**: Checks for existing DXVK installations by examining DLLs and prompts to overwrite if a different version is detected.
- **Automated Download**: Fetches the specified or latest DXVK release from [GitHub](https://github.com/doitsujin/dxvk/releases) with a configurable connection timeout.
- **User-Friendly CLI**: Provides clear, colored output using `colorama` for interactive prompts and error messages.
- **Progress Bar**: Displays a download progress bar using `tqdm`.
- **Flexible Installation**: Copies DLLs to the game directory's `system32` (and `syswow64` for x64 if it exists) or directly to the game directory if no subdirectories are found.
- **Support for Wine and DXVK Native**: Works with both Wine-based setups and DXVK Native for game ports.
- **Fast JSON Parsing**: Uses `orjson` for efficient parsing of GitHub API responses.
- **Error Handling**: Provides clear error messages for invalid inputs, failed downloads, missing files, or invalid DXVK releases.
## Troubleshooting
- **No .exe files found**: If auto-detection fails because no `.exe` files are found, the script will prompt for manual DXVK version selection. Ensure the game directory contains the game's executable.
- **Invalid DXVK release**: If the specified `--dxvk-release` (e.g., `v2.3`) is not found on GitHub, check the available releases at [DXVK Releases](https://github.com/doitsujin/dxvk/releases). The release format must be `vX.Y` or `vX.Y.Z`.
- **Failed to analyze .exe files**: Ensure `pefile` is installed (`pip install pefile`) and that the `.exe` files are accessible and not corrupted.
- **DLLs not loaded by game**: Verify DLL overrides in `winecfg` for Wine or check the game's DLL loading path for DXVK Native.
- **Network errors / timeouts**: The script enforces a 5-second connection timeout and a 30-second read timeout. Ensure a stable internet connection when downloading DXVK releases.
## License
This project is licensed under the [MIT License](LICENSE).