Repository navigation
A run chooses the GPU adapter the sidecar works on - #11
Merged
Merged
Conversation
`-gpu-adapter <spec>`, or FFRWD_GPU_ADAPTER where the flag is absent, names the adapter the process's one device is opened on, so the modules granted -gpu, the decoder, the encoders and the filters sharing that device move together. The spec is an index into the list `--gpu-info` prints or a case-insensitive part of an adapter's name, looked for in the preferred backend first. A spec naming no one adapter ends the run with exit 2 when the device is first opened, naming the adapters there are; no other adapter is opened in its place. Unset, the device opens where it always has. `ffrwd-wasm --gpu-info` prints each adapter's index, name, backend, vendor and device ids, type, and whether it is the default, and with a spec which one it names or why it is refused. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`ffrwd run` and `ffrwd compile` take `--gpu-adapter SPEC`, with FFRWD_GPU_ADAPTER as the default where the flag is absent. Each sidecar that opens the GPU device (a module granted -gpu, or a decode, encode or filter node) is given `-gpu-adapter SPEC` after its grants, and so is a compile-time call into a module granted the GPU. With neither set no argv changes, so the printed commands and the cookbook pins stay as they are. Before spawning, a run checks the spec against `ffrwd-wasm --gpu-info` and refuses one naming no one adapter as RUNTIME_NOT_FOUND, naming the adapters there are. `ffrwd setup gpu` prints them as a table, with the one a run opens. A remote run refuses the flag, since it runs on the runner's own adapter. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The dialect's grants, recipe 157's paragraph on the device, and the README's command table say how `--gpu-adapter` or FFRWD_GPU_ADAPTER puts the device on another adapter, and that `ffrwd setup gpu` lists them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A run can choose the GPU adapter the sidecar works on, for its modules, the decoder, the encoders and the filters together, since all of them share the sidecar's one device.
--gpu-adapter SPEConffrwd runandcompile, orFFRWD_GPU_ADAPTERwhere the flag is absent; the sidecar's-gpu-adapter. A spec is an index into the adapter list or a case-insensitive part of a name, looked up in the preferred backend first (the 4090 is listed on both D3D12 and Vulkan here). No match, or two matches in one backend, is refused with the list of adapters and a hint, and no other adapter is opened; unset, nothing changes, pins included.ffrwd-wasm --gpu-infoprints the adapters as JSON (index, name, backend, type, vendor and device ids, the default);ffrwd setup gpuprints them as a table and says which one a run opens.-gpu-adapterto each sidecar that opens the device (agpugrant, or a decode, encode or filter node) and to compile-time calls into a module granted the GPU.On the RTX 4090 machine: the 4090 opens by
4090,nvidia,0and2(Vulkan); WARP opens by1orbasic renderand runsgpu_boxwith frames identical to the host path;radeonand99are refused with the message. Tests: Rust unit tests over synthetic adapter lists, fourgpu_framestests that run unchanged on any machine, and CLI tests of the argv spelling, the refusal, the remote refusal andsetup gpu.conftestunsets the variable so a developer's setting cannot move a pin.Not covered without a second hardware adapter: whether d3d12va decode, the
_d3d12vaencoders andscale_d3d12run on a chosen non-default card. Paths that open a device of their own stay on the default card:hw=autodecoding into host memory, nvenc and AMF from host memory, ONNX Runtime's CUDA provider, and DirectML with no module granted the GPU.Checks: cargo fmt and clippy
-D warningsclean with default features and--no-default-features; lib and bins 223 and 80; gpu_frames 20; ruff and mypy clean; unit tier 5148; cookbook exec 174 passed, 1 skipped.🤖 Generated with Claude Code