Files
metal2vulkan/docs
Anees Iqbal 760f8d045b Runtime lane: a device the driver refused for want of room is made again once other processes may have let it go
The 2080 legs of round 9ce951f521 failed 33 of 2,054 lane tests at device
creation: 27 devices of the queue plan that the driver refused (the
runtime then took its least plan and announced least-queue-plan, which
the lane's creation check rejects) and 6 lane devices of 3 VkQueues it
refused outright (Error::DeviceRefused, ERROR_INITIALIZATION_FAILED or
ERROR_OUT_OF_HOST_MEMORY).

Cause, measured: NVIDIA's driver gives each VkQueue a channel with an
instance block of its own, and refuses a device where it cannot allocate
one (the kernel logs "Could not create Channel"). A device of the plan
takes 18 VkQueues on the RTX 2080 (14 round robin, 2 presenting, the
staging and fill queues; its copy family's 2 queues put the copy queue on
the fill queue's), a lane device 3. With nothing else running the 2080
(NVIDIA 620.70.06) holds about 210 channels across processes: 11 runtime
devices of the plan and 3 of the least plan, the 15th refused (job
m3-max-19615), and 66 bare devices of 3 with room for 18 (19562). The
legs run 16 test processes, 188 of the lane's 408 modules make devices of
the plan, and nextest runs a module's cases side by side: 16 x 18 = 288
VkQueues. Lane 2/2's indirect_executions shards, 64 tests at the plan in
a row, took 22 least plans. Nothing leaks: each lane test is its own
process, every helper drops its device in a scope, and a runtime device
makes one vkCreateDevice whose queues its threads never add to.

Neither answer is the test's: its device is the one it asked for, and
the GPU lacked room only while the lane's other processes held theirs
(the runtime's DeviceRefused docs: a device asked for again once fewer
are live may be made). So validated_device_with makes such a device
again, the one made dropped first, after a pause doubling from 0.25 s to
2 s, for at most 120 s in all (runtime_lane/device_room.rs), and
made_lane_device does the same for a refusal. Only Error::DeviceRefused
and a least-queue-plan announced as the device was made are asked
again; any other answer returns at once, and past the bound the last
answer is handed back, failing the test as before. Each pause writes a
LANE-DEVICE-ROOM line naming the answer, the pause and the time waited.
No lock and no cross-process coordination: the driver's answer is the
only signal. The runtime's least plan and refusal stay its own tests'
(tests::least_queue_plan, the driver's refusal stood in for).

Tests: runtime_lane::device_room's unit tests (no device): a short
answer is asked again with doubling pauses until one has room; an answer
with room returns with no pause; one that never has room stops at the
bound. docs/VALIDATION.md's few-channels paragraph says what the lane
does now; degrade_notices' LEAST_PLANS says why no lane test keeps it.

Verified: cargo fmt; build, clippy and the tests in the lane's jobs.
2026-11-15 12:06:06 -08:00
..