Setting Up Ubuntu 25 for Gaming with GeForce RTX 4090

A complete guide for 4k HDR gaming, 3D audio, and Xbox controller support

Introduction

This guide covers the complete setup process for gaming on Ubuntu 25.04 with an NVIDIA RTX 4090, including HDR support, spatial audio, and Xbox Elite 2 controller configuration. These instructions are based on real-world testing and successful implementations.

Prerequisites

  • Ubuntu 25.04 installed
  • NVIDIA GeForce RTX 4090
  • HDR-capable monitor (tested with ASUS XG27UCS)
  • Xbox Elite 2 controller (or similar Xbox controller)
  • DisplayPort cable for 4K HDR support

Graphics Driver Setup

Step 1: Add Graphics Drivers PPA

# Add the official graphics drivers PPA for newest drivers
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

Step 2: Install NVIDIA Proprietary Driver

# Check available drivers
ubuntu-drivers devices

# Install NVIDIA 575 driver (proprietary - required for HDR support)
sudo apt install nvidia-driver-575

# Important: Do NOT use the open-source nouveau or NVK drivers as they don't support HDR or ray tracing

Step 3: Enable DRM Kernel Mode Setting

Create the NVIDIA configuration file:

sudo nano /etc/modprobe.d/nvidia-drm.conf

Add this line:

options nvidia-drm modeset=1

Update initramfs and reboot:

sudo update-initramfs -u
sudo reboot

Step 4: Verify Installation

# Check driver version
nvidia-smi

# Verify DRM modeset is enabled
cat /sys/module/nvidia_drm/parameters/modeset
# Should output "Y"

# Verify you're using proprietary driver, not NVK
glxinfo | grep "OpenGL renderer"
# Should show: NVIDIA GeForce RTX 4090/PCIe/SSE2
# NOT: NVK

HDR Setup

Desktop HDR Support

Ubuntu 25.04 includes native HDR support through GNOME 48. While this enables HDR for the desktop, games do not recognize this HDR support directly.

Enable Desktop HDR:

  1. Open SettingsDisplays
  2. Select your HDR monitor
  3. Toggle HDR to ON
  4. The screen may flicker briefly as HDR activates

Important Note: Even with HDR enabled in GNOME, games did not detect HDR capability without using Gamescope. The GNOME compositor’s HDR implementation is not recognized by games running through Wine/Proton at the time of writing.

Gaming HDR Support via Gamescope

To get HDR working in games, you must use Gamescope as a wrapper. Gamescope provides the HDR signaling that games can detect and use.

Step 1: Install Gamescope

sudo apt install gamescope

Step 2: Universal Gamescope HDR Command

For all games requiring HDR, use this launch command in Steam:

VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait DXVK_HDR=1 gamescope -W 3840 -H 2160 -w 3840 -h 2160 -r 160 --hdr-enabled --hdr-debug-force-output -f -- %command%

Command breakdown:

  • VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait – Prevents frame presentation hangs
  • DXVK_HDR=1 – Enables HDR in DirectX translation layer
  • gamescope – The wrapper that provides HDR support
  • -W 3840 -H 2160 – Output resolution (4K)
  • -w 3840 -h 2160 – Game internal resolution (4K native)
  • -r 160 – Refresh rate limit
  • --hdr-enabled – Enable HDR mode
  • --hdr-debug-force-output – Force HDR output even if game doesn’t request it
  • -f – Fullscreen mode

Step 3: Apply to Steam Games

  1. Right-click any game in Steam
  2. Select Properties
  3. Paste the command above into Launch Options
  4. The game will now launch with HDR support

Note: Without Gamescope, games will not detect HDR capability even though the desktop has HDR enabled. This is a limitation of the current GNOME HDR implementation.

Diablo 4 Installation with Battle.net

Overview

Getting Diablo 4 working with HDR and ray tracing requires installing Battle.net through Steam using Proton, then launching with Gamescope.

Step 1: Download Battle.net Installer

  1. Download the Battle.net installer from: https://www.blizzard.com/download/
  2. Save Battle.net-Setup.exe to a known location (e.g., ~/Downloads/)

Step 2: Add Battle.net Installer to Steam

  1. Open Steam
  2. Click “Add a Game”“Add a Non-Steam Game”
  3. Click “Browse” and navigate to your Battle.net installer
  4. Select Battle.net-Setup.exe and click “Add Selected Programs”

Step 3: Configure Proton for Battle.net

  1. In Steam Library, find Battle.net-Setup.exe
  2. Right-click → Properties
  3. Go to Compatibility tab
  4. Check “Force the use of a specific Steam Play compatibility tool”
  5. Select Proton Experimental from the dropdown

Step 4: Install Battle.net

  1. Click Play on Battle.net-Setup.exe in Steam
  2. The installer will launch through Proton
  3. Complete the Battle.net installation process
  4. Important: Do NOT close Steam or remove the installer entry yet

Step 5: Create Diablo 4 Launch Entry

  1. After Battle.net installs, locate the Battle.net.exe: # It will be in a path like: ~/.steam/steam/steamapps/compatdata/[STEAM_ID]/pfx/drive_c/Program Files (x86)/Battle.net/Battle.net.exe
  2. Add Battle.net.exe to Steam:
    • “Add a Game”“Add a Non-Steam Game”“Browse”
    • Navigate to the Battle.net.exe location
    • Add it to Steam
  3. Rename it to “Diablo 4” for clarity

Step 6: Configure Diablo 4 Entry

  1. Right-click “Diablo 4” (Battle.net.exe) → Properties
  2. In Compatibility tab:
    • Enable “Force the use of a specific Steam Play compatibility tool”
    • Select Proton Experimental
  3. In Launch Options, add the standard HDR command: VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait DXVK_HDR=1 gamescope -W 3840 -H 2160 -w 3840 -h 2160 -r 160 --hdr-enabled --hdr-debug-force-output -f -- %command%

Step 7: Hide but Keep the Installer Entry

Critical: The Battle.net-Setup.exe entry creates the Proton prefix (folder structure) that Diablo 4 needs. You must keep it but can hide it:

  1. Right-click Battle.net-Setup.exe in Steam Library
  2. Select ManageHide this game
  3. Never delete this entry – it maintains the Proton prefix that Diablo 4 requires

Step 8: Install and Configure Diablo 4

  1. Launch “Diablo 4” from Steam (this opens Battle.net)
  2. Log into your Battle.net account
  3. Install Diablo 4 through the Battle.net client
  4. Once installed, Diablo 4 will launch through the gamescope wrapper with HDR enabled

Step 9: Enable Ray Tracing

Ray tracing requires the proprietary NVIDIA driver (575). If ray tracing options are grayed out:

  1. Verify you’re using the proprietary driver: glxinfo | grep "OpenGL renderer" # Must show: NVIDIA GeForce RTX 4090/PCIe/SSE2 # NOT: NVK
  2. In Diablo 4, go to SettingsGraphics
  3. Ray tracing options should now be available

3D Audio Setup

Step 1: Install Required Packages

# Core audio packages
sudo apt install pipewire pipewire-pulse pipewire-alsa wireplumber
sudo apt install pavucontrol helvum alsa-utils

# OpenAL for 3D positional audio
sudo apt install libopenal1 libopenal-data openal-info

# Audio effects processor
sudo apt install easyeffects

Step 2: Configure OpenAL for HRTF

Create OpenAL configuration:

mkdir -p ~/.config/openal
nano ~/.config/openal/alsoft.conf

Add this configuration:

[general]
hrtf = true
hrtf-mode = full
frequency = 48000
channels = stereo
sample-type = float32

[pulse]

allow-moves = true adjust-latency = true fix-rate = true

[hrtf]

search-path = /usr/share/openal/hrtf search-path = ~/.local/share/openal/hrtf

Step 3: Set Up Virtual Surround (Safe Method)

Create a safe virtual surround configuration:

# Create virtual surround sink
pactl load-module module-remap-sink \
    sink_name=virtual-surround \
    sink_properties=device.description="Virtual 5.1 Surround" \
    master=@DEFAULT_SINK@ \
    channels=6 \
    channel_map=front-left,front-right,front-center,lfe,rear-left,rear-right \
    remix=no

Step 4: Configure EasyEffects

  1. Launch EasyEffects:
easyeffects
  1. Create a preset called “Gaming Audio” with these effects:
    • Crossfeed: Cutoff 700 Hz, Feed 4.5 dB
    • Stereo Tools: Default settings
    • Equalizer: Adjust to taste

Step 5: Test Audio Setup

# Test surround sound
speaker-test -t wav -c 6

# For Steam games, add to launch options if needed:
PULSE_LATENCY_MSEC=60 %command%

Xbox Elite 2 Controller Setup

Step 1: Connect via Bluetooth

  1. Put controller in pairing mode: Hold Xbox button + Connect button (small button on top) for 3 seconds
  2. Open SettingsBluetooth
  3. Click Add Device and select your controller

Step 2: Install xpadneo Driver

The xpadneo driver provides better Xbox controller support:

# Install dependencies
sudo apt install dkms linux-headers-$(uname -r)

# Clone and install xpadneo
git clone https://github.com/atar-axis/xpadneo.git
cd xpadneo
sudo ./install.sh

Step 3: Configure Steam

  1. Open Steam → SettingsControllerGeneral Controller Settings
  2. Enable “Enable Steam Input for Xbox controllers” (toggle should be blue)
  3. Your controller should appear in the detected controllers list

Step 4: Troubleshooting Controller Detection

If Steam doesn’t detect your controller:

# Add user to input group
sudo usermod -a -G input $USER
# Log out and back in for changes to take effect

# Test controller at system level
sudo apt install joystick
jstest /dev/input/js0

# Force Steam to use Linux joystick interface
SDL_JOYSTICK_HIDAPI=0 steam

For persistent fix, add to ~/.bashrc:

export SDL_JOYSTICK_HIDAPI=0

Performance Optimizations

CPU Governor

Set CPU to performance mode while gaming:

sudo apt install cpupower
sudo cpupower frequency-set -g performance

GPU Performance Mode

# Set GPU to maximum performance
sudo nvidia-smi -pm 1
sudo nvidia-smi -pl 450  # Set power limit (adjust for your card)

Disable Compositor for Gaming

For X11 sessions, disable compositor effects:

# Add to game launch options
__GL_YIELD="USLEEP" %command%

Troubleshooting

HDR Not Working

  1. Desktop HDR but games don’t detect it: This is expected – games require Gamescope for HDR
  2. Ensure you’re using DisplayPort (not HDMI)
  3. Check monitor HDR is enabled in monitor’s OSD
  4. Verify NVIDIA driver version is 575 (proprietary)
  5. Confirm Gamescope is in the launch options

Controller Not Detected

  1. Check Bluetooth connection: bluetoothctl devices
  2. Verify system detection: cat /proc/bus/input/devices | grep Xbox
  3. Restart Steam with: SDL_JOYSTICK_HIDAPI=0 steam
  4. Check permissions: ls -la /dev/input/js*

Audio Issues

  1. Reset PipeWire:
systemctl --user restart pipewire pipewire-pulse wireplumber
  1. Check audio devices:
pactl list short sinks
  1. If buzzing occurs, kill all audio processes:
pkill -f pipewire
pkill -f wireplumber
pkill -f easyeffects

Game-Specific Issues

  • Ray tracing grayed out: Ensure you’re using proprietary NVIDIA driver 575, not nouveau or NVK
  • HDR not detected in games: Games require Gamescope – native GNOME HDR is not recognized by games
  • Poor HDR colors: This is a known limitation with Gamescope on GNOME; colors may appear washed out
  • Input lag: The VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait in the launch command should fix this
  • Battle.net crashes: Ensure the hidden Setup.exe entry still exists in Steam library

Verification Commands

# Check NVIDIA driver
nvidia-smi

# Verify DRM modeset
cat /sys/module/nvidia_drm/parameters/modeset

# Test controller
jstest /dev/input/js0

# Check audio setup
pactl list short sinks
speaker-test -t wav -c 6

# Monitor GPU performance
nvidia-smi dmon -s pucvmet

Standard Gamescope HDR Launch Command

For all games requiring HDR, use this single command:

VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait DXVK_HDR=1 gamescope -W 3840 -H 2160 -w 3840 -h 2160 -r 160 --hdr-enabled --hdr-debug-force-output -f -- %command%

Final Notes

  • GNOME’s HDR support is desktop-only – games cannot detect it without Gamescope
  • The proprietary NVIDIA 575 driver is required for HDR and ray tracing support – do not use NVK or nouveau
  • For best HDR experience, consider KDE Plasma 6 on Fedora as an alternative
  • Always use DisplayPort for 4K@160Hz HDR (HDMI may not support full bandwidth)
  • Keep Battle.net-Setup.exe entry hidden but not deleted in Steam for Diablo 4 to work
  • Check ProtonDB for game-specific tweaks and compatibility notes

This setup has been tested and confirmed working with:

  • NVIDIA RTX 4090 with driver 575 (proprietary)
  • ASUS XG27UCS monitor (4K@160Hz HDR)
  • Xbox Elite Series 2 controller
  • Ubuntu 25.04 with GNOME 48
  • Steam with Proton Experimental
  • Battle.net and Diablo 4 with HDR and ray tracing

Happy gaming on Linux!