📝 Say the library now opens the device a variable names [ci skip]

The Mesa-layer entry said the library takes the loader's first device whenever a
selection variable is set. selmatch (75ef99afe) changed that: device_choice now
opens the device a variable names, by its IDs or DRI_PRIME's PCI address, so the
entry says what the library did and what it does now.
This commit is contained in:
Anees Iqbal committed 2026-11-14 22:36:23 -08:00
1 parent 0c0791a46f
commit 52caf9a576
1 file changed
+1 -1
+1 -1
View File
@@ -98,7 +98,7 @@ one. A new trap found the same way goes here.
- A guest failure that only the harness's device configuration reaches belongs to the harness, so walks run reims-ctl's devices. The appwalk harness kept one virtio sound device with an output and an input stream after reims-ctl moved to a playback-only device and a capture-only one (bca8c6e7f). On it, macOS 11.7.11's coreaudiod died in 1 of 4 walks at the tip, and the crash read as a new fault in our virtio-snd: AppleVirtIOSound starts and stops the input stream with every output there, and frees a stopped input ring while its four receive buffers are still posted, so each sound could crash it (12 rounds of system sounds did, m3-max-25374, as on vendor/qemu from before our capture changes, m3-max-25417), where on reims-ctl's two devices 60 rounds started no input stream and it lived (m3-max-25414; [qemu.md](qemu.md), "x86-64 macOS guests: audio"). How to spot the next one: before reading a failure as the product's, diff the harness's QEMU command against `reims-ctl`'s (`crates/reims-ctl/src/qemu.rs`) and boot once with reims-ctl's.
- A QMP command that waits for a device holds every QMP monitor, and a release under the BQL waits for every callback that takes it. QMP's `screendump` is a coroutine command: it waits until the console's update is done, and QMP's dispatcher runs one command at a time for every monitor, so reims-graphics-pci's read of the display waiting for a GPU that never answered (NVIDIA's Xid 109, RTX 2080 and RTX 3090, 2026-11-12) left `query-status`, `system_powerdown` and every other screendump unanswered until the quit, while HMP, the vCPUs and the guest went on. And the device's teardown at the quit held the BQL across the library's release of its last device, which waits up to 5 s for the library's threads, while `route_doorbell`, which one of those threads calls as a command queue is made or ends, takes the BQL: a queue made or destroyed as the VM quit held the quit for the 5 s, read in review (commitpath2). A late read now answers the update with what the console shows (`REIMS_GRAPHICS_PCI_READ_LATE_MS`), and the release at the quit runs with the BQL let go. Before a device answers QEMU later than at once, bound what the answer waits for; before a host call that waits for the library's threads runs under a lock, list the callbacks that take that lock. The next one shows as QMP silent while HMP answers, or as a quit that takes 5 s and logs that "the GPU device stays for the process".
- A window over a Metal app decides how much the compositor draws, so two timed runs whose desktops differ read as a change in the build. Apple's Modern Rendering sample, started over SSH and so never the active app, ran at 5.21 frames a second on um870's RTX 3090 (macOS 26.7.2) in one run and at 4.74 to 4.89 in each run after a guest commit, WindowServer's context at 252 to 286 render encoders a second where it had done 47, and the commit was blamed. The desktops differed: in the fast run no active window lay over the sample, and in the slow ones an active window with a glass sidebar did (System Settings, open after login, or the Finder window the harness's desk reset opened with `open -a Finder`), and WindowServer's context ran about 2 command buffers a frame of the sample, of 26 to 30 render encoders each, against about 1 of 10. Two builds without the commit, run with System Settings active on the 780M, read the same 2 command buffers and 49 to 51 encoders a frame; and one build read 4.74 frames a second and 285 encoders a second with the Finder window over the sample (m3-max-26185), and 5.18 and 36 with the sample brought to the front (m3-max-26247). How to spot the next one: bring the app under test to the front before timing it, take a screenshot mid-run, and where WindowServer's encoders per command buffer moved between two runs, compare their screens before their builds.
- The loader's `VK_LOADER_DEVICE_SELECT` does not pick the GPU on a host with Mesa's device-select layer, which every node and msi carry (`vulkan-mesa-implicit-layers`). The layer sorts the GPUs after the loader has, and puts its own default first unless `MESA_VK_DEVICE_SELECT` (or `DRI_PRIME`) names a GPU, so the loader's pick ends up behind it. On um870, with an RTX 3090 and a Radeon 780M (loader 1.4.363, Mesa 26.2.6), `VK_LOADER_DEVICE_SELECT=0x10de:0x2204` alone listed the 780M (the boot VGA device) first, in a job with no window system; `MESA_VK_DEVICE_SELECT=10de:2204`, or both variables, listed the 3090 first; the loader's variable alone did so only with the layer off (`NODEVICE_SELECT=1`) (**measured**, 2026-11-14, job m3-max-30538, through `reims-ctl __vulkan-probe`). The library takes the first device whenever one of the selection variables is set (`device_choice`), so it opens the layer's default and logs it as the user's pick. reims-ctl names a VM's GPU in both variables (`crates/reims-ctl/src/gpu.rs`). How to spot the next one: a run whose device line (metal2vulkan's `the device NAME:`) is not the GPU a variable named; list the order under the variables with `reims-ctl __vulkan-probe`, which prints one line a device in the order an instance sees them.
- The loader's `VK_LOADER_DEVICE_SELECT` does not pick the GPU on a host with Mesa's device-select layer, which every node and msi carry (`vulkan-mesa-implicit-layers`). The layer sorts the GPUs after the loader has, and puts its own default first unless `MESA_VK_DEVICE_SELECT` (or `DRI_PRIME`) names a GPU, so the loader's pick ends up behind it. On um870, with an RTX 3090 and a Radeon 780M (loader 1.4.363, Mesa 26.2.6), `VK_LOADER_DEVICE_SELECT=0x10de:0x2204` alone listed the 780M (the boot VGA device) first, in a job with no window system; `MESA_VK_DEVICE_SELECT=10de:2204`, or both variables, listed the 3090 first; the loader's variable alone did so only with the layer off (`NODEVICE_SELECT=1`) (**measured**, 2026-11-14, job m3-max-30538, through `reims-ctl __vulkan-probe`). The library took the first device whenever one of the selection variables was set, so it opened the layer's default and logged it as the user's pick; `device_choice` now opens the device a variable names, by its IDs or its PCI address. reims-ctl names a VM's GPU in both variables (`crates/reims-ctl/src/gpu.rs`). How to spot the next one: a run whose device line (metal2vulkan's `the device NAME:`) is not the GPU a variable named; list the order under the variables with `reims-ctl __vulkan-probe`, which prints one line a device in the order an instance sees them.
## Tools and worktrees