{"record":{"id":"9b25b5b90a9a7de0","repo":"tracel-ai/burn","slug":"cannot-host-a-remote-server-on-a-capture-device","errorCode":null,"errorMessage":"Cannot host a remote server on a capture device","messagePattern":"Cannot host a remote server on a capture device","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-dispatch/src/remote_server.rs","lineNumber":105,"sourceCode":"                $body\n            }\n            #[cfg(feature = \"ndarray\")]\n            DispatchDevice::NdArray(_) => {\n                type $b = NdArray;\n                let $devices = host_devices!(DispatchDeviceId::NdArray, NdArray);\n                $body\n            }\n            #[cfg(feature = \"tch\")]\n            DispatchDevice::LibTorch(_) => {\n                panic!(\"LibTorch is not supported as a remote-server backend (no BackendIr impl)\")\n            }\n            #[cfg(feature = \"remote\")]\n            DispatchDevice::Remote(_) => {\n                panic!(\"Cannot host a remote server on a remote device\")\n            }\n            #[cfg(feature = \"capture\")]\n            DispatchDevice::Capture(_) => {\n                panic!(\"Cannot host a remote server on a capture device\")\n            }\n            #[cfg(feature = \"autodiff\")]\n            DispatchDevice::Autodiff(_) => {\n                unreachable!(\"Autodiff stripped by .inner() above\")\n            }\n        }\n    };\n}\n\n/// Start a remote-execution server for `device`'s backend, blocking the current thread.\n///\n/// `device` selects the backend; `channel` selects the transport. The server hosts that backend's\n/// devices, indexed by hardware device index. Use [`start_async`] for the async counterpart.\n#[cfg(not(target_family = \"wasm\"))]\npub fn start(device: DispatchDevice, channel: Channel) {\n    with_backend!(device, |B, devices| {\n        burn_remote::server::RemoteServerBuilder::<B>::new(devices)\n            .channel(channel)","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-dispatch/src/remote_server.rs#L87-L123","documentation":"This panic occurs when hosting a remote server on a Capture device. Capture devices record/replay op traces rather than executing them via a BackendIr backend, so they cannot serve as the execution backend for a remote server. The server panics immediately rather than producing broken recordings.","triggerScenarios":"Starting a remote server whose host device resolves to DispatchDevice::Capture(_) (feature \"capture\" enabled and the capture device passed as the server device).","commonSituations":"Reusing a capture/profiling session's device configuration for the server binary; build configurations where the capture feature wraps devices by default and the server picks up the wrapped device.","solutions":["Use the underlying (un-captured) device for the server host, e.g., DispatchDevice::NdArray over the raw backend device.","Disable the `capture` feature in the server binary if capture wrapping is unintentional.","Keep capture purely client-side; the server must always run a BackendIr-capable local backend."],"exampleFix":"// before\nlet device = DispatchDevice::Capture(capture_device);\n// after\nlet device = DispatchDevice::NdArray(ndarray_device); // use capture_device.inner() locally instead","handlingStrategy":"validation","validationCode":"match device {\n    DispatchDevice::Capture(_) => return Err(\"cannot host a remote server on a capture device\".into()),\n    _ => {}\n}","typeGuard":"fn is_host_capable_device(d: &DispatchDevice) -> bool {\n    !matches!(d, DispatchDevice::Capture(_) | DispatchDevice::Remote(_) | DispatchDevice::LibTorch(_))\n}","tryCatchPattern":null,"preventionTips":["Unwrap capture devices (.inner()) before passing a device to server hosting code.","Disable the `capture` feature in server builds so capture wrapping cannot occur.","Restrict capture sessions to client-side profiling only."],"tags":["rust","remote-server","capture","dispatch","config"],"backgroundTag":"unsupported-backend-for-remote-server","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}