upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/boot.md
diff options
context:
space:
mode:
authorTauwni <102470988+Tauwni@users.noreply.github.com>2026-11-26 04:01:08 +0100
committerTauwni <102470988+Tauwni@users.noreply.github.com>2026-11-26 04:01:08 +0100
commit5af6cd3d69dc69baec78aa06fc418fc4bcbf83b5 (patch)
tree4529bc04eac714e9c393fb1085bb1d67169843c0 /docs/boot.md
parent459cbb9b19193ffd4fbb18442497bc885de8c728 (diff)
parent7f3d0095a2d51892bc7048f24505c37168f25c34 (diff)
Merge remote-tracking branch 'origin/main' into gpu-results-m3
# Conflicts: # docs/gpu_test_results.md
Diffstat (limited to 'docs/boot.md')
-rw-r--r--docs/boot.md70
1 files changed, 67 insertions, 3 deletions
diff --git a/docs/boot.md b/docs/boot.md
index 2b7186e30..3ba791f88 100644
--- a/docs/boot.md
+++ b/docs/boot.md
@@ -95,9 +95,11 @@ Useful switches:
95 This switch covers imports only; it does not affect the D3D12 outcomes. 95 This switch covers imports only; it does not affect the D3D12 outcomes.
96* `LEONIDA_SKIP_CPU_CHECK=1` skips the AVX preflight of `--init` and `--run`, which otherwise exits 4 with one line 96* `LEONIDA_SKIP_CPU_CHECK=1` skips the AVX preflight of `--init` and `--run`, which otherwise exits 4 with one line
97 naming the missing feature on a host without AVX (a QEMU `qemu64` guest; under Rosetta, set 97 naming the missing feature on a host without AVX (a QEMU `qemu64` guest; under Rosetta, set
98 `ROSETTA_ADVERTISE_AVX=1` instead). The game itself still needs AVX, so this is for the #UD emulation work. 98 `ROSETTA_ADVERTISE_AVX=1` instead). The game itself still needs AVX, so this is for the #UD emulation work (see
99 [cpu_features.md](cpu_features.md#hosts-without-avx) for what works on a host without AVX).
99* `LEONIDA_SKIP_INT3=1` (with `--trace`) steps over each int3 in guest code and logs it once per address as an 100* `LEONIDA_SKIP_INT3=1` (with `--trace`) steps over each int3 in guest code and logs it once per address as an
100 `int3_skipped` event, so a boot can be followed past soft asserts (an int3 followed by code that carries on). 101 `int3_skipped` event, so a boot can be followed past soft asserts (an int3 followed by code that carries on). It is
102 read when the trace opens.
101 Diagnostic only: a correct run reaches none, so each skipped address is a finding, not a fix. A failed guest file 103 Diagnostic only: a correct run reaches none, so each skipped address is a finding, not a fix. A failed guest file
102 open is always traced as `file_open_failed` (path, error, caller) when `--trace` is on. 104 open is always traced as `file_open_failed` (path, error, caller) when `--trace` is on.
103* `LEONIDA_STUB_PIPELINES=1` creates a pipeline whose translated shader is missing (no shader library, or no entry 105* `LEONIDA_STUB_PIPELINES=1` creates a pipeline whose translated shader is missing (no shader library, or no entry
@@ -116,13 +118,75 @@ Useful switches:
116 diagnostic). 118 diagnostic).
117* `LEONIDA_DEVICE_FAULT=1` enables Vulkan device-loss diagnostics and checkpoints where available. The first 119* `LEONIDA_DEVICE_FAULT=1` enables Vulkan device-loss diagnostics and checkpoints where available. The first
118 observed loss prints a `[rt] device-fault:` report to stderr. 120 observed loss prints a `[rt] device-fault:` report to stderr.
121* `LEONIDA_TITLE_HUD=1` shows live counters in the title bar of the window the title presents in
122 (`runtime/shims/title_hud.h`). It updates twice a second with:
123 - the frame rate and the average and worst frame time from PresentX, or, when no frame came in that half
124 second, how long since the last one (a hang reads "0 fps, no frame for 12.5 s");
125 - the process's private memory (its commit charge; Wine fills only `PagefileUsage`, which is the same figure)
126 and working set;
127 - its GPU memory: in use and the budget over the device-local heaps, and in use in the other heaps, read from
128 the Vulkan device through `VK_EXT_memory_budget`. Without that extension it falls back to DXGI's
129 `QueryVideoMemoryInfo`, which reads 0 under Wine; with neither the field reads `VRAM n/a`, not a false 0.
130 Both memory figures and their text come from `runtime/src/memory_figures.h`, which the dev overlay shows too;
131 - the graphics and compute pipelines created, and the seconds spent in `vkCreate*Pipelines` in the last half
132 second. A pipeline compiled in the frame shows up there as a hitch. This needs `LEONIDA_MEM_PROBE`; without it
133 the field reads `PSO -`.
134 - the time since the first present.
135
136 A thread of its own sets the text with `SendMessageTimeout`, so a busy window thread never holds a present.
137* `LEONIDA_DEV_OVERLAY=1` (Windows) shows what the runtime is doing in a small click-through window over the top left
138 corner of the title's window, while that window is in front (`runtime/src/dev_overlay.h`): frames and submissions a
139 second, where a submission's CPU time goes, the phase that is running now and for how long, pipeline builds in
140 flight, indirect draws emitted and skipped, cores, free RAM, and the same private memory and GPU memory figures as
141 `LEONIDA_TITLE_HUD` (`VRAM n/a` without `VK_EXT_memory_budget`). The device publishes its GPU memory figure, and
142 the overlay and the HUD read it at most once per half second. The rates cover the last two seconds. It has its own
143 thread, so it also counts while the title presents nothing, and it is in no capture. `LEONIDA_TITLE_HUD` shows frame
144 times and compile times in the title bar instead; both can be on.
119* `DISABLE_RTSS_LAYER=1` and `DISABLE_VULKAN_OBS_CAPTURE=1` when MSI Afterburner or OBS is installed; their 145* `DISABLE_RTSS_LAYER=1` and `DISABLE_VULKAN_OBS_CAPTURE=1` when MSI Afterburner or OBS is installed; their
120 implicit layers add swapchain usage that shows up as validation errors ([testing.md](testing.md), "Known 146 implicit layers add swapchain usage that shows up as validation errors ([testing.md](testing.md), "Known
121 problems"). 147 problems").
122* `--overlay DIR` sends the guest's writes to DIR instead of the default `<game-dir>\overlay` (useful when the 148* `--overlay DIR` sends the guest's writes to DIR instead of the default `<game-dir>\overlay` (useful when the
123 package drive is read-only); the package itself is never written. Set `LEONIDA_WRITE_DIR` to override that folder 149 package drive is read-only); the package itself is never written. Set `LEONIDA_WRITE_DIR` to override that folder
124 for one run (it wins over `--overlay`). For a fresh first-run profile, also set `LEONIDA_SAVE_DIR` to a separate 150 for one run (it wins over `--overlay`). For a fresh first-run profile, also set `LEONIDA_SAVE_DIR` to a separate
125 empty directory for the local game-save provider. 151 empty directory for the local game-save provider. The title's `T:` drive (its temporary drive,
152 where it writes its crash dump `T:\<guid>.dmp` and crash log) is a folder of each process's own inside the overlay,
153 `<overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>` (the process's start time in UTC and its id).
154 The folder is reserved with a create-only `CreateDirectoryW` when `gta6rt` starts the title (or on the first `T:`
155 call): when that name already exists, as after a reused process id in the same millisecond, it takes `-2`, `-3`,
156 ... (up to 1000 names), so a run never writes into a folder that existed before it. The startup line names it
157 (`console paths: GAME: -> ..., writes -> ..., T: -> ...`).
158 Folders of earlier runs are kept, so a run's crash files can be read after it stops; delete them by hand. With
159 one folder for every run, a `CREATE_NEW` of a name an earlier run had left failed with `ERROR_FILE_EXISTS` (80)
160 and no report landed (old upstream issue 7913).
161
162### Under Wine on Linux
163
164The prefix has to supply a `d3d12.dll` that exports `D3D12SerializeVersionedRootSignature`, because the executable
165imports it. Wine's own `d3d12.dll` does not answer that export for the runtime's shim, and the failure is quiet:
166the D3D12 trace ends at about 1,658 calls, the startup trace ends in an access violation inside the executable,
167and the one line that names the cause is
168`[rt] d3d12_xs: host d3d12.dll has no D3D12SerializeVersionedRootSignature`. The run never reaches
169`CreateRootSignature`.
170
171Copying the DLLs a Proton prefix installs is not enough on its own: Wine keeps preferring its own copy next to
172them. Name them in the overrides.
173
174```bash
175GE=$HOME/GE-Proton11-13-x86_64/files/lib/wine
176cp "$GE/vkd3d-proton/x86_64-windows/d3d12.dll" \
177 "$GE/vkd3d-proton/x86_64-windows/d3d12core.dll" \
178 "$GE/dxvk/x86_64-windows/dxgi.dll" "$WINEPREFIX/drive_c/windows/system32/"
179export WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n,b"
180export LEONIDA_D3D12=vulkan
181export LEONIDA_SHADERS='Z:\path\to\shaders\spirv'
182wine ./gta6rt.exe --run 'Z:\path\to\game_scarlett_master.exe' --game-dir 'Z:\path\to\the\package' \
183 --trace /tmp/boot.jsonl --trace-d3d12
184```
185
186With those three DLLs and the override, the same prefix reaches the frame loop: about 1.4 million D3D12 calls in
18790 s, no exception, `PresentX ready`, against 1,658 calls and an access violation without them, measured on Wine
18811.13 (GE-Proton 11-13) with an RDNA2 iGPU. A prefix that Proton itself created already carries these files and
189needs no override.
126 190
127## 3. Triage order 191## 3. Triage order
128 192