{"record":{"id":"9d911ff41e25610f","repo":"tracel-ai/burn","slug":"burn-device-rocm-requested-but-the-rocm-feature","errorCode":null,"errorMessage":"BURN_DEVICE=rocm requested, but the 'rocm' feature is not enabled.","messagePattern":"BURN_DEVICE=rocm requested, but the 'rocm' feature is not enabled\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-dispatch/src/device.rs","lineNumber":242,"sourceCode":"\n        #[cfg(feature = \"std\")]\n        {\n            if let Ok(device_str) = std::env::var(\"BURN_DEVICE\") {\n                match device_str.to_lowercase().as_str() {\n                    // Every cubecl runtime is the one `Cube` backend; the name here\n                    // picks the runtime the device names, and the wgpu spellings all\n                    // reach wgpu, whose compiler is chosen for it at runtime.\n                    \"cuda\" => {\n                        #[cfg(feature = \"cuda\")]\n                        return Self::Cube(CubeDevice::Cuda(Default::default()));\n                        panic!(\n                            \"BURN_DEVICE=cuda requested, but the 'cuda' feature is not enabled.\"\n                        );\n                    }\n                    \"rocm\" => {\n                        #[cfg(feature = \"rocm\")]\n                        return Self::Cube(CubeDevice::Hip(Default::default()));\n                        panic!(\n                            \"BURN_DEVICE=rocm requested, but the 'rocm' feature is not enabled.\"\n                        );\n                    }\n                    \"metal\" | \"vulkan\" | \"webgpu\" | \"wgpu\" => {\n                        #[cfg(any(\n                            feature = \"metal\",\n                            feature = \"vulkan\",\n                            feature = \"webgpu\",\n                            feature = \"wgpu\"\n                        ))]\n                        return Self::Cube(CubeDevice::Wgpu(Default::default()));\n                        panic!(\n                            \"BURN_DEVICE={device_str} requested, but no wgpu feature is enabled.\"\n                        );\n                    }\n                    \"cpu\" => {\n                        #[cfg(feature = \"cpu\")]\n                        return Self::Cube(CubeDevice::Cpu(Default::default()));","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-dispatch/src/device.rs#L224-L260","documentation":"Same BURN_DEVICE selection guard for the `rocm` value: the default-device constructor returns a HIP/ROCm device only if the `rocm` feature is enabled; otherwise it panics, indicating the requested runtime is absent from the build. The failing input is `BURN_DEVICE=rocm` against a binary compiled without ROCm support.","triggerScenarios":"Thrown at crates/burn-dispatch/src/device.rs:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable the `rocm` feature and rebuild.","Choose another enabled backend via BURN_DEVICE.","Unset BURN_DEVICE to use the compile-time default backend."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}