Skip to content

About

Proof of concept: NVIDIA's driver can't be patched like RADV, so a Vulkan layer does the same job. It maps driver memory (dma-buf, mremap, sparse binding) to the title's addresses for CPU and GPU at once.

Resources

Stars

57 stars

Watchers

4 watching

Forks

 
 

Repository files navigation

VIctory xmem for NVIDIA

VIctory on Linux with an NVIDIA RTX card, built on VIctory-xmem. The title's memory is the card driver's own memory, shown at the title's own addresses to the processor and to the card at once, the way the console shares it, so nothing is copied back and forth every frame.

No game files in here. Bring your own dump.

How it gets past the memory wall

The console has one memory; a PC has two, with PCIe in between. Almost every other build keeps a copy of title memory for the card and keeps both in step on the processor every frame. xmem removes that copy on AMD by patching the open Mesa driver.

NVIDIA's Vulkan driver cannot be patched, but its kernel side is open and Linux's memory tools work with it. With NVIDIA's open kernel modules the driver's memory (RAM, and the card's own through resizable BAR) is exported as a Linux dma-buf; a Vulkan layer (nvidia/um-layer/) maps it at the title's addresses with mremap and binds the same pages into the card's view through sparse buffers. Title memory is then not copied at all; what is still copied each frame (the rest, beside it) takes the processor 1-2 ms (copy_ms in the play log). xmem has no path without this: it does not start without the layer. Windows has no public way to put driver memory at an address of the title's choosing, which is why this is Linux only. Details and measurements: nvidia/README.md.

Status (2026-12-01)

About 14-17 fps at 2560x1440 (Series X profile, ray tracing on), steady for hours, on the one machine tested: Ryzen 7 5800X, 32 GB, RTX 4070 12 GB, Ubuntu 24.04, NVIDIA 615.71.09 with the open kernel modules. Not in that: the decal heaps' defragmentation, left out on NVIDIA (15-21 ms of the card a frame); one compute program that still needs waves of 64 lanes; and four ray-traced sun shadow pipelines that NVIDIA's compiler takes over 45 s for. In the prologue the card is the limit there, not the processor: it has work queued 84-96 % of every frame, and no thread of ours or the title's takes a whole core (the submitting thread 9-15 ms of a 55-77 ms frame). The title's ray-traced light costs some 10 ms a frame (13.6-15.1 frames a second with it, 16.1-18.5 without: VICTORY_BVH_BUILDER=0).

Tested on

One machine: Ryzen 7 5800X, 32 GB RAM, RTX 4070 12 GB (Ada), Linux Mint / Ubuntu 24.04 base under X11 (Cinnamon), NVIDIA 615.71.09 with the open kernel modules, GE-Proton 11-15, 2560x1440. Nothing else has been run here yet.

./run.sh doctor checks a machine against this (driver, kernel modules, Resizable BAR, Vulkan extensions, card, Proton, RAM, disk, desktop) and says PASS, WARN or FAIL with why; play prints its warnings in short.

Needs

  • An NVIDIA RTX card with the open kernel modules, driver 615 (tested here; 595 was reported to work on an RTX 3090; avoid 620.70.x, which can freeze the desktop on failed GPU mappings: NVIDIA PR #1542).
  • Resizable BAR on (BIOS: Above 4G Decoding and Re-Size BAR).
  • At least 12 GB of VRAM. Cards with 8 GB do not get to the world (reported): in the world the card holds ~8.6 GB here (RTX 4070 12 GB, driver budget ~10 GB): ~3 GB of title memory, the 1.5 GB texture pool, render targets, the ray tracing structures and vkd3d-proton's own. run.sh doctor fails below ~11 GB.
  • To build: LLVM 19 or newer (clang-cl, lld-link, llvm-lib; versioned names such as clang-cl-20 are found), the MinGW toolchain with widl, Rust (rustup), glslang, meson's needs; setup.sh names what is missing with the command that installs it on Debian/Ubuntu/Mint, Fedora and Arch.

Known problems

  • Only Ada (RTX 40) is tested here. An RTX 3090 (Ampere) on driver 595 was reported to work (~14 fps over 40 minutes with ray tracing, the card the limit). Its world was black for the first 10-20 minutes before: NVIDIA's shader cache missed the large ray tracing pipelines every start (their embedded samplers' places differed from run to run), fixed since; see nvidia/README.md.
  • On Cinnamon the desktop was reported to crash with the game in a window: VICTORY_FULLSCREEN=1.
  • The very first run on a new NVIDIA shader cache (and the first after a translator change) misses objects for its first minutes while pipelines are made.
  • Where Enter does not reach the account screen (key events to the window lost), AUTO_ENTER=1 presses it through the game's stand-in pad instead (at set times until the world draws); by hand: VICTORY_KEYS=25:Enter,30:Enter,35:Enter,45:Enter,60:Enter,75:Enter,90:Enter.
  • setup.sh asks for Microsoft's license for the Windows SDK; without a terminal, read it and run it again with ACCEPT_MS_LICENSE=1.

Run

./setup.sh
echo 'GAME=/path/to/your/dump' > run.conf
./run.sh shaders
./run.sh play

setup.sh fetches and builds vkd3d-proton, the NVIDIA layer, a wineserver for your Wine, the Windows SDK and VIctory itself. It names any tool it misses. Saves, caches and logs stay in local/.

The first play prepares every pipeline from your dump before the game opens: on NVIDIA this takes hours the first time. If you interrupt it, run play again and it resumes. Close the game through its window rather than killing it, so the driver keeps its shader cache.

Settings go after the mode, or in run.conf:

Setting Effect
CONSOLE=series-s Series S profile
VICTORY_OUTPUT=2560x1440 Render size
VICTORY_FULLSCREEN=1 Borderless full screen
VICTORY_FULLSCREEN_RES=2560x1440 Its size, if not the screen's
VICTORY_BVH_BUILDER=0 No ray tracing
VICTORY_RENDER_SCALE=0.5 The title's render scale (2/3 by default): 0.5 is 1280x720 inside 2560x1440, ~5-13 % more frames a second, a softer picture (nvidia/README.md)
VICTORY_SKIP_BINK=1 Skip the title's movies that play once (logos, intro); all skips the looping menu backgrounds too (they stay dark). Off by default
MUTE=1 No sound
AUTO_ENTER=1 Pass the account screen by itself (Enter through the stand-in pad until the world draws; AUTO_ENTER=xtest: X11 key events to the window, as before)

The NVIDIA settings are in nvidia/README.md.

Patches

patches/ holds what changes in vkd3d-proton and Wine (and Mesa, for the AMD path this came from). Edit under deps/<name>, rebuild with ./setup.sh <name>, save with tools/patch.sh <name>.

Credits

VIctory-xmem by lobomfz, the unified memory this builds on; victory-linux-nvidia by dfmbrollins, for pair meetings and other NVIDIA fixes; VIctory by Marvisak and contributors, through avatarmanz, fxceless, DexNom, Belobug, FQY55kai, myokex, triippywhale, trustno1-coder, PastiiJay, Geckomacabre, cxy0072019-sketch and gassy.

License

GPL-3.0-or-later. See LICENSE.

About

Proof of concept: NVIDIA's driver can't be patched like RADV, so a Vulkan layer does the same job. It maps driver memory (dma-buf, mremap, sparse binding) to the title's addresses for CPU and GPU at once.

Resources

Stars

57 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages