tracel-ai/burn · error

BURN_DEVICE= requested, but no wgpu feature is enabled.

Error message

BURN_DEVICE={device_str} requested, but no wgpu feature is enabled.

What it means

BURN_DEVICE selection guard for wgpu-family values (`metal`, `vulkan`, `webgpu`, `wgpu`): the constructor returns a wgpu cube device only when at least one of those wgpu features is compiled in; otherwise it panics with the requested string. It fires when the environment asks for a GPU runtime the binary lacks any backing feature for.

Solutions

  1. Enable one of the wgpu features (metal, vulkan, webgpu, wgpu) and rebuild.
  2. Set BURN_DEVICE to a backend available in the current build.
  3. Unset BURN_DEVICE and rely on the default.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/burn-dispatch/src/device.rs:254 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/b8be3326e60ec915. Report an issue: GitHub.

Appendix: source

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

                            "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()));
                        panic!("BURN_DEVICE=cpu requested, but the 'cpu' feature is not enabled.");
                    }
                    "tch" => {
                        #[cfg(feature = "tch")]
                        return Self::LibTorch(LibTorchDevice::default());
                        panic!("BURN_DEVICE=tch requested, but the 'tch' feature is not enabled.");
                    }
                    "remote" => {
                        #[cfg(feature = "remote")]
                        return Self::Remote(RemoteDevice::default());
                        panic!(
                            "BURN_DEVICE=remote requested, but the 'remote' feature is not enabled."

View on GitHub (pinned to d16f7ba2ed)