Skip to content

Building Rust applications for ADLX

Navigation: Programming with ADLXADLX Programming GuideQuick Start

This guide outlines the steps to build a Rust application that uses ADLX. Unlike the C#, Java, and Python bindings, Rust does not require a separate C/C++ binding project. Rust binds to the ADLX C interface directly through FFI using the amd-adlx crate, which declares the required ADLX interfaces (vtables) and provides a small AdlxHelper loader that mirrors SDK/ADLXHelper/Windows/C/ADLXHelper.c.

Prerequisite(s)

  • ADLX SDK is installed.
  • Rust 1.70 (or newer) with the x86_64-pc-windows-msvc toolchain is installed.

Note: The ADLX library (amdadlx64.dll / amdadlx32.dll) is installed along with the AMD display driver and is loaded at runtime. No import library or header is needed to build a Rust application using amd-adlx.

To use ADLX in a Rust application

  • Add the amd-adlx crate as a dependency in your application’s Cargo.toml.
  • Use AdlxHelper to initialize ADLX and access ADLX features:
use amd_adlx::AdlxHelper;
fn main() {
let helper = AdlxHelper::new().expect("Failed to initialize ADLX");
let system = helper.system();
for gpu in system.gpus().expect("Failed to enumerate GPUs") {
println!("{}", gpu.name().unwrap_or_default());
}
}

Note: Refer to the Rust samples Rust Samples for complete, working examples of how amd-adlx is used.

See Also: Rust Samples