fix(scripts): make the NVIDIA BAR window cap opt-in

Expose the cap in MiB as a launcher parameter and keep the existing More override. Restore the runtime default for launches that omit the cap.

Refs: #6
This commit is contained in:
Jeremy Goldberg committed 2026-11-26 12:40:48 -05:00
1 parent ce6b2545e7
commit 1b0fd752a5
2 files changed
+14 -15

No files matched your search

+8 -8
View File
@@ -290,14 +290,14 @@ What to expect:
memory. Use 720p or lower on Series S. memory. Use 720p or lower on Series S.
- Series S cannot go above 1080p: its output is 1080p, and the script says so - Series S cannot go above 1080p: its output is 1080p, and the script says so
and stops if asked for more. and stops if asked for more.
- **16 GB of RAM works, with a resizable BAR.** Windows lets a card share at - **On 16 GB PCs, try `-WindowsBarMB 3072` with resizable BAR enabled.**
most half the PC's memory, and the copies of title memory the GPU reads On the tested 16 GB PC with an RTX 3060, shared GPU memory approached its
filled that on a 16 GB PC about a minute into the world (`0x8007000E`, then a limit about a minute into the world (`0x8007000E`, then a driver fault).
driver fault). `play-nvidia.ps1` now puts them in the card's memory the CPU The 3072 MiB cap from [PR #6](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/6)
maps (`VICTORY_WINDOWS_BAR_MB`) when the BIOS has resizable BAR on; let eligible title memory windows use CPU-mapped VRAM while the card had room.
`nvidia-smi -q -d MEMORY` shows a BAR1 total about the card's size if so. The launcher leaves this off by default. Pass a cap in MiB to
Without it, close what else uses memory. Expect stutters while the world `play-nvidia.ps1` or any resolution wrapper. `-WindowsBarMB 0` disables it,
streams in: the game's own memory is then partly in the paging file. and `-More @{VICTORY_WINDOWS_BAR_MB='...'}` takes precedence.
### More than one card, and other cards ### More than one card, and other cards
+6 -7
View File
@@ -12,6 +12,7 @@
# (-Adapter '#1'). Default: Windows' default card (the one the main display is on). # (-Adapter '#1'). Default: Windows' default card (the one the main display is on).
# -Build target\diag (the default, the build all measurements are of) or target\release # -Build target\diag (the default, the build all measurements are of) or target\release
# (the release build ignores the ray-tracing skip list: VICTORY_SKIP_PIPELINES is a diagnostics switch) # (the release build ignores the ray-tracing skip list: VICTORY_SKIP_PIPELINES is a diagnostics switch)
# -WindowsBarMB maximum MiB of title memory windows in CPU-mapped VRAM (0 by default).
# -More other settings: -More @{VICTORY_PANEL='1'} # -More other settings: -More @{VICTORY_PANEL='1'}
# Run it from a normal window, not as administrator: the driver then keeps its shader cache elsewhere. # Run it from a normal window, not as administrator: the driver then keeps its shader cache elsewhere.
param( param(
@@ -23,7 +24,8 @@ param(
[ValidateSet('2160', '1440', '1080', '720', '540', '480')][string]$Resolution, [ValidateSet('2160', '1440', '1080', '720', '540', '480')][string]$Resolution,
[string]$Adapter, [string]$Adapter,
[ValidateSet('diag', 'release')][string]$Build = 'diag', [ValidateSet('diag', 'release')][string]$Build = 'diag',
[hashtable]$More = @{} [hashtable]$More = @{},
[uint32]$WindowsBarMB
) )
$settings = @{ $settings = @{
# This fork's play set (scripts\play.ps1, not -Safe): the speed set. # This fork's play set (scripts\play.ps1, not -Safe): the speed set.
@@ -54,12 +56,6 @@ $settings = @{
VICTORY_CARD_BUFFERS_MIN_MB = '1'; VICTORY_CARD_BUFFERS_MB = '1536' VICTORY_CARD_BUFFERS_MIN_MB = '1'; VICTORY_CARD_BUFFERS_MB = '1536'
# Series S presents the interface as a second plane: laid over the game (compose.rs), else black before gameplay. # Series S presents the interface as a second plane: laid over the game (compose.rs), else black before gameplay.
VICTORY_COMPOSE = '1' VICTORY_COMPOSE = '1'
# Windows of title memory outside buffers in card memory the CPU maps (resizable BAR), up to 3 GB, while the
# card has room (shadow.rs window_mapped_for). Otherwise they live in the PC's memory shared with the card,
# which Windows caps at half the RAM: on a 16 GB PC (RTX 3060) the shared memory reached 7.5 GB about a minute
# into the world and every run ended in 0x8007000E, then a fault in the driver. With this: no crash, the shared
# memory flat at about 4.4 GB, 10-12 fps instead of 2-3. Without a resizable BAR it changes nothing.
VICTORY_WINDOWS_BAR_MB = '3072'
} }
# Ray tracing mostly off. The structure builder cannot run on NVIDIA (its 64-lane programs are refused; upstream # Ray tracing mostly off. The structure builder cannot run on NVIDIA (its 64-lane programs are refused; upstream
# Marvisak/VIctory pull request 2311), so every ray misses, and the passes that turn misses into light made rooms go # Marvisak/VIctory pull request 2311), so every ray misses, and the passes that turn misses into light made rooms go
@@ -87,6 +83,9 @@ if ($Resolution) {
$settings.VICTORY_RENDER_SCALE = ([int]$Resolution / $outHeight).ToString('0.####', [Globalization.CultureInfo]::InvariantCulture) $settings.VICTORY_RENDER_SCALE = ([int]$Resolution / $outHeight).ToString('0.####', [Globalization.CultureInfo]::InvariantCulture)
} }
if ($Adapter) { $settings.VICTORY_ADAPTER = $Adapter } if ($Adapter) { $settings.VICTORY_ADAPTER = $Adapter }
if ($PSBoundParameters.ContainsKey('WindowsBarMB')) {
$settings.VICTORY_WINDOWS_BAR_MB = $WindowsBarMB.ToString([Globalization.CultureInfo]::InvariantCulture)
}
foreach ($k in $More.Keys) { $settings[$k] = $More[$k] } foreach ($k in $More.Keys) { $settings[$k] = $More[$k] }
$scale = [double]::Parse($settings.VICTORY_RENDER_SCALE, [Globalization.CultureInfo]::InvariantCulture) $scale = [double]::Parse($settings.VICTORY_RENDER_SCALE, [Globalization.CultureInfo]::InvariantCulture)
Write-Host "Series $console, rendering at $([int]($outHeight * $scale))p (render scale $($settings.VICTORY_RENDER_SCALE))" Write-Host "Series $console, rendering at $([int]($outHeight * $scale))p (render scale $($settings.VICTORY_RENDER_SCALE))"