You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to run burn according to the burn book example (https://burn.dev/book/getting-started.html), but it displayed "No adapter found for graphics API AutoGraphicsApi".
this is the Cargo.toml:
[package]
name = "my_burn_app"
version = "0.1.0"
edition = "2021"
[dependencies]
burn = { version = "0.13.0", features = ["wgpu"] }
And this is the main function:
use burn::tensor::Tensor;
use burn::backend::Wgpu;
// Type alias for the backend to use.
type Backend = Wgpu;
fn main() {
let device = Default::default();
// Creation of two tensors, the first with explicit values and the second one with ones, with the same shape as the first
let tensor_1 = Tensor::<Backend, 2>::from_data([[2., 3.], [4., 5.]], &device);
let tensor_2 = Tensor::<Backend, 2>::ones_like(&tensor_1);
// Print the element-wise addition (done with the WGPU backend) of the two tensors.
println!("{}", tensor_1 + tensor_2);
}
When I run it using cargo run, the following error occurred:
[wangjw@localhost my_burn_app]$ cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.23s
Running `target/debug/my_burn_app`
thread 'main' panicked at /home/wangjw/.cargo/registry/src/index.crates.io-6f17d22bba15001f/burn-wgpu-0.13.0/src/runtime.rs:278:17:
No adapter found for graphics API AutoGraphicsApi
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The text was updated successfully, but these errors were encountered:
For wgpu you might need to install the correct graphics drivers depending on what you want to target. By default, the AutoGraphicsApi targets metal on MacOs and vulkan on other operating systems. For vulkan you can do apt install vulkan (and possibly vulkan-tools if you want to validate the installation).
If you want to use another graphics API you can be explicit when using the wgpu backend. For example, the guide defines the backend as
typeMyBackend = Wgpu<AutoGraphicsApi,f32,i32>;
But if you explicitly want to target OpenGl, you can use this instead
Hi,
I am trying to run burn according to the burn book example (https://burn.dev/book/getting-started.html), but it displayed "No adapter found for graphics API AutoGraphicsApi".
this is the Cargo.toml:
And this is the main function:
When I run it using cargo run, the following error occurred:
The text was updated successfully, but these errors were encountered: