# GPU This project uses **WebGPU** via the `wgpu` crate, so the same code runs on Vulkan, Metal, DX12, and WebGPU/wasm. ## GPU selection (all stages) By default the pipeline asks wgpu for the **discrete** (high-performance) adapter and logs which one it picked: ``` [gpu] using AMD Radeon RX 9070 XT (RADV GFX1201) (DiscreteGpu) via Vulkan ``` If you see an integrated GPU or a software (llvmpipe) adapter, force the right backend/device. The `request_adapter` fallback enumerates adapters and prefers a discrete GPU. On dual-GPU laptops set `WGPU_POWER_PREF` / run under the discrete-GPU driver profile if wgpu still picks the iGPU. ## YOLO masks on the GPU (ONNX Runtime → MIGraphX) The masks stage runs YOLO through **ONNX Runtime**, loaded **dynamically from the system libonnxruntime** (`ORT_DYLIB_PATH`) rather than a downloaded CPU-only build. On AMD/ROCm systems that system lib is built with the **MIGraphX** execution provider, so: ```bash # GPU inference on an AMD GPU pipeline_360 masks --input-dir 03_cubemap/images --output-dir 03_cubemap/masks \ --mask-model yolo11x-seg.onnx --mask-device rocm --mask-imgsz 1280 # CPU (no ROCm/MIGraphX runtime needed) pipeline_360 masks --input-dir 03_cubemap/images --output-dir 03_cubemap/masks \ --mask-model yolo11x-seg.onnx --mask-device cpu ``` - If the GPU EP can't be registered, the stage **falls back to CPU** and warns. - The binary is built with `--features masks` by default. - On your system the GPU-enabled `libonnxruntime` must be findable — the build uses `load-dynamic`, so it `dlopen`s `libonnxruntime.so` (or whatever `ORT_DYLIB_PATH` points at) at runtime, and ROCm must be installed. ### Compiled-model cache (important for first run) MIGraphX compiles the ONNX graph to GPU kernels on the **first run**, which is slow (minutes for a large model like `yolo11x-seg` on a new GPU). It caches the compiled `.mxr` and loads it on later runs. The pipeline **auto-sets `ORT_MIGRAPHX_CACHE_PATH`** to `~/.cache/pipeline_360/migraphx` (override with `--mask-ep-cache