tracel-ai/burn · error

BURN_DEVICE=rocm requested, but the 'rocm' feature is not en

Error message

BURN_DEVICE=rocm requested, but the 'rocm' feature is not enabled.

What it means

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.

Source

Thrown at crates/burn-dispatch/src/device.rs:242

        #[cfg(feature = "std")]
        {
            if let Ok(device_str) = std::env::var("BURN_DEVICE") {
                match device_str.to_lowercase().as_str() {
                    // Every cubecl runtime is the one `Cube` backend; the name here
                    // picks the runtime the device names, and the wgpu spellings all
                    // reach wgpu, whose compiler is chosen for it at runtime.
                    "cuda" => {
                        #[cfg(feature = "cuda")]
                        return Self::Cube(CubeDevice::Cuda(Default::default()));
                        panic!(
                            "BURN_DEVICE=cuda requested, but the 'cuda' feature is not enabled."
                        );
                    }
                    "rocm" => {
                        #[cfg(feature = "rocm")]
                        return Self::Cube(CubeDevice::Hip(Default::default()));
                        panic!(
                            "BURN_DEVICE=rocm requested, but the 'rocm' feature is not enabled."
                        );
                    }
                    "metal" | "vulkan" | "webgpu" | "wgpu" => {
                        #[cfg(any(
                            feature = "metal",
                            feature = "vulkan",
                            feature = "webgpu",
                            feature = "wgpu"
                        ))]
                        return Self::Cube(CubeDevice::Wgpu(Default::default()));
                        panic!(
                            "BURN_DEVICE={device_str} requested, but no wgpu feature is enabled."
                        );
                    }
                    "cpu" => {
                        #[cfg(feature = "cpu")]
                        return Self::Cube(CubeDevice::Cpu(Default::default()));

View on GitHub (pinned to d16f7ba2ed)

Solutions

  1. Enable the `rocm` feature and rebuild.
  2. Choose another enabled backend via BURN_DEVICE.
  3. Unset BURN_DEVICE to use the compile-time default backend.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/burn-dispatch/src/device.rs:242 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tracel-ai/burn@d16f7ba2ed (2026-09-05). Data as JSON: /api/errors/9d911ff41e25610f. Report an issue: GitHub.