Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

Installing CubeCL is straightforward. It’s available as a Rust crate, and you can add it to your project by updating your Cargo.toml:

[dependencies]
cubecl = {
    version = "0.6.0",  # Replace with the latest version from crates.io
    features = ["wgpu"]  # Enable desired runtime features (e.g., wgpu, cuda, hip)
}

The more challenging aspect is ensuring that you have the necessary drivers to run the selected runtime.

CubeCL supports multiple GPU runtimes, each requiring specific drivers or frameworks. Enable the appropriate feature flag in Cargo.toml and ensure the corresponding drivers are installed.

PlatformRuntimeSupported OSRequirementsInstallation/NotesFeature Flag
WebGPUwgpuLinux, Windows, macOS, wasmVulkan drivers (typically pre-installed on modern OSes)On linux install the vulkan driver.wgpu
CUDACUDALinux, WindowsNVIDIA CUDA drivers and toolkitDownload and install from the NVIDIA CUDA Downloads page. Verify installation with nvidia-smi.cuda
ROCmHIPLinux, WindowsAMD ROCm frameworkLinux: Follow the ROCm Linux Quick Start. Windows: See the ROCm Windows Installation Guide.hip
MetalwgpumacOSApple device with Metal support (macOS 10.13 or later)No additional drivers needed; Metal is built into macOS.wgpu-msl
VulkanwgpuLinux, WindowsVulkan driversOn linux install via package manager, on windows it is typically included with GPU drivers (NVIDIA/AMD).wgpu-spirv