Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic while playing with the MNIST example in the book #2754

Open
schneiderfelipe opened this issue Jan 28, 2025 · 3 comments
Open

Panic while playing with the MNIST example in the book #2754

schneiderfelipe opened this issue Jan 28, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@schneiderfelipe
Copy link

schneiderfelipe commented Jan 28, 2025

I got a panic while playing around with the MNIST example in the book. The panic only happens in release mode.
=== PANIC ===
A fatal error happened, you can check the experiment logs here => '/tmp/guide/experiment.log'
============= Val dating
thread '<unnam2d>' panicked at /home/schneider/.cargo/registry/src/index.crates.i159f17d22bba15001f/burn-tensor-0.16.0/src/repr/handle.rs:73:32:    9996/10000                                      2192=
== PANIC ===handle for tensor TensorId { value: 560132 }
A fatal error happened, you can check the experiment logs here => '/tmp/guide/experiment.log' 20                             8
=============
thread 'main' panicked at /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/burn-train-0.16.0/src/checkpoint/async_checkpoint.rs:94:14:
Can send message to checkpointer thread.: SendError { .. }
=== PANIC ===
A fatal error happened, you can check the experiment logs here => '/tmp/guide/experiment.log'
=============
thread 'main' panicked at /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/burn-train-0.16.0/src/checkpoint/async_checkpoint.rs:128:14:
Can send the end message to the checkpointer thread.: SendError { .. }
stack backtrace:
   0:     0x5668f7a6d4fa - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::ha4a311b32f6b4ad8
   1:     0x5668f7a9a9e3 - core::fmt::write::h1866771663f62b81
   2:     0x5668f7a69623 - std::io::Write::write_fmt::hb549e7444823135e
   3:     0x5668f7a6d342 - std::sys::backtrace::BacktraceLock::print::hddd3a9918ce29aa7
   4:     0x5668f7a6e7cd - std::panicking::default_hook::{{closure}}::h791f75256b902d7d
   5:     0x5668f7a6e613 - std::panicking::default_hook::h82cc572fcb0d8cd7
   6:     0x5668f7104dd2 - <burn_train::learner::application_logger::FileApplicationLoggerInstaller as burn_train::learner::application_logger::ApplicationLoggerInstaller>::install::{{closure}}::h77e2c6f6ff92ab3b
   7:     0x5668f710c679 - burn_train::renderer::tui::renderer::TuiMetricsRenderer::new::{{closure}}::h27b9179c09b9f73d
   8:     0x5668f7a6ee78 - std::panicking::rust_panic_with_hook::he21644cc2707f2c4
   9:     0x5668f7a6ec3a - std::panicking::begin_panic_handler::{{closure}}::h42f7c414fed3cad9
  10:     0x5668f7a6d9d9 - std::sys::backtrace::__rust_end_short_backtrace::ha26cf5766b4e8c65
  11:     0x5668f7a6e8cc - rust_begin_unwind
  12:     0x5668f67fa9a0 - core::panicking::panic_fmt::h74866b78e934b1c0
  13:     0x5668f67fade6 - core::result::unwrap_failed::h899ed7ab2ccb8159
  14:     0x5668f6eeee62 - core::ptr::drop_in_place<burn_train::checkpoint::async_checkpoint::AsyncCheckpointer<hashbrown::map::HashMap<burn_core::module::param::id::ParamId,burn_core::optim::simple::record::base::AdaptorRecord<burn_core::optim::adam::Adam,burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>>,burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>>::haf14eb5ad61a0a62
  15:     0x5668f6eeddab - core::ptr::drop_in_place<core::option::Option<burn_train::learner::base::LearnerCheckpointer<burn_train::components::LearnerComponentsMarker<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>,f64,burn_guide::model::Model<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>,burn_core::optim::simple::adaptor::OptimizerAdaptor<burn_core::optim::adam::Adam,burn_guide::model::Model<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>,burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>,burn_train::checkpoint::async_checkpoint::AsyncCheckpointer<burn_guide::model::ModelRecord<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>,burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>,burn_train::checkpoint::async_checkpoint::AsyncCheckpointer<hashbrown::map::HashMap<burn_core::module::param::id::ParamId,burn_core::optim::simple::record::base::AdaptorRecord<burn_core::optim::adam::Adam,burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>>,burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>,burn_train::checkpoint::async_checkpoint::AsyncCheckpointer<(),burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::r
untime::WgpuRuntime,f32,i32,u32>>>>,burn_train::metric::processor::async_wrapper::AsyncProcessor<burn_train::metric::processor::full::FullEventProcessor<burn_train::learner::classification::ClassificationOutput<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>,burn_train::learner::classification::ClassificationOutput<burn_fusion::backend::Fusion<burn_jit::backend::JitBackend<cubecl_wgpu::runtime::WgpuRuntime,f32,i32,u32>>>>>,alloc::boxed::Box<dyn burn_train::checkpoint::strategy::base::CheckpointingStrategy>>>>>::h9cf380e113eb48e2
  16:     0x5668f6ec1bdf - burn_train::learner::train_val::<impl burn_train::learner::base::Learner<LC>>::fit::h6807f0986758d6c9
  17:     0x5668f6f105ac - burn_guide::training::train::hf698af0f69835af7
  18:     0x5668f6f807a7 - burn_guide::main::h5f6dcfebad806f91
  19:     0x5668f6ee4b56 - std::sys::backtrace::__rust_begin_short_backtrace::h7a7a80380fc540fd
  20:     0x5668f6fb2163 - std::rt::lang_start::{{closure}}::h701caaa2f840ff64
  21:     0x5668f7a61d07 - std::rt::lang_start_internal::h78dd36c15a6b42b8
  22:     0x5668f6f80805 - main
  23:     0x747959e2a1ca - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  24:     0x747959e2a28b - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  25:     0x5668f67fb0c5 - _start
  26:                0x0 - <unknown>
=== PANIC ===
A fatal error happened, you can check the experiment logs here => '/tmp/guide/experiment.log'
=============
thread 'main' panicked at core/src/panicking.rs:231:5:
panic in a destructor during cleanup
thread caused non-unwinding panic. aborting.
[1]    45703 IOT instruction (core dumped)  cargo run --release

I'm using the WGPU backend. I've also attached the experiment.log and config.json files.

@laggui laggui added the bug Something isn't working label Jan 28, 2025
@laggui
Copy link
Member

laggui commented Jan 28, 2025

Root:

thread '<unnam2d>' panicked at /home/schneider/.cargo/registry/src/index.crates.i159f17d22bba15001f/burn-tensor-0.16.0/src/repr/handle.rs:73:32:    9996/10000                                      2192=
== PANIC ===handle for tensor TensorId { value: 560132 }

Seems very much related to this user's error posted on discord this morning

I can't reproduce the issue on the last release but will try to look into it.

If you try the latest github revision instead of the last release do you still have this issue? There have been some minor changes in this area so curious if it had any impact.

@schneiderfelipe
Copy link
Author

@laggui I'm unable to compile in release mode due to compilation errors.
cargo run --release
   Compiling burn-guide v0.1.0 (/home/schneider/Dropbox/burn-guide)
error[E0275]: overflow evaluating the requirement `wgpu_core::validation::NumericType: Sync`
    |
    = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`burn_guide`)
note: required because it appears within the type `wgpu_core::validation::InterfaceVar`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/validation.rs:109:12
    |
109 | pub struct InterfaceVar {
    |            ^^^^^^^^^^^^
note: required because it appears within the type `wgpu_core::validation::Varying`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/validation.rs:136:6
    |
136 | enum Varying {
    |      ^^^^^^^
note: required because it appears within the type `PhantomData<wgpu_core::validation::Varying>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:753:12
    |
753 | pub struct PhantomData<T: ?Sized>;
    |            ^^^^^^^^^^^
note: required because it appears within the type `alloc::raw_vec::RawVec<wgpu_core::validation::Varying>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:76:19
    |
76  | pub(crate) struct RawVec<T, A: Allocator = Global> {
    |                   ^^^^^^
note: required because it appears within the type `Vec<wgpu_core::validation::Varying>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:397:12
    |
397 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    |            ^^^
note: required because it appears within the type `wgpu_core::validation::EntryPoint`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/validation.rs:149:8
    |
149 | struct EntryPoint {
    |        ^^^^^^^^^^
    = note: required because it appears within the type `((naga::ShaderStage, std::string::String), wgpu_core::validation::EntryPoint)`
    = note: required for `RawTable<((ShaderStage, String), EntryPoint)>` to implement `Sync`
note: required because it appears within the type `HashMap<(ShaderStage, String), EntryPoint, BuildHasherDefault<...>>`
   --> /rust/deps/hashbrown-0.15.0/src/map.rs:185:12
note: required because it appears within the type `HashMap<(ShaderStage, String), EntryPoint, BuildHasherDefault<...>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:211:12
    |
211 | pub struct HashMap<K, V, S = RandomState> {
    |            ^^^^^^^
note: required because it appears within the type `wgpu_core::validation::Interface`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/validation.rs:161:12
    |
161 | pub struct Interface {
    |            ^^^^^^^^^
note: required because it appears within the type `std::option::Option<wgpu_core::validation::Interface>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:572:10
    |
572 | pub enum Option<T> {
    |          ^^^^^^
note: required because it appears within the type `wgpu_core::pipeline::ShaderModule`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/pipeline.rs:48:12
    |
48  | pub struct ShaderModule {
    |            ^^^^^^^^^^^^
    = note: required for `Arc<wgpu_core::pipeline::ShaderModule>` to implement `Send`
note: required because it appears within the type `ManuallyDrop<Arc<wgpu_core::pipeline::ShaderModule>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/manually_drop.rs:157:12
    |
157 | pub struct ManuallyDrop<T: ?Sized> {
    |            ^^^^^^^^^^^^
note: required because it appears within the type `MaybeUninit<Arc<wgpu_core::pipeline::ShaderModule>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/maybe_uninit.rs:241:11
    |
241 | pub union MaybeUninit<T> {
    |           ^^^^^^^^^^^
    = note: required because it appears within the type `[MaybeUninit<Arc<wgpu_core::pipeline::ShaderModule>>; 2]`
note: required because it appears within the type `arrayvec::arrayvec::ArrayVec<Arc<wgpu_core::pipeline::ShaderModule>, 2>`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrayvec-0.7.6/src/arrayvec.rs:43:12
    |
43  | pub struct ArrayVec<T, const CAP: usize> {
    |            ^^^^^^^^
note: required because it appears within the type `wgpu_core::pipeline::RenderPipeline`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/pipeline.rs:578:12
    |
578 | pub struct RenderPipeline {
    |            ^^^^^^^^^^^^^^
    = note: required for `std::sync::Weak<wgpu_core::pipeline::RenderPipeline>` to implement `Send`
note: required because it appears within the type `wgpu_core::binding_model::ExclusivePipeline`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/binding_model.rs:478:17
    |
478 | pub(crate) enum ExclusivePipeline {
    |                 ^^^^^^^^^^^^^^^^^
    = note: required for `OnceLock<wgpu_core::binding_model::ExclusivePipeline>` to implement `Send`
note: required because it appears within the type `wgpu_core::binding_model::BindGroupLayout`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/binding_model.rs:508:12
    |
508 | pub struct BindGroupLayout {
    |            ^^^^^^^^^^^^^^^
    = note: required for `Arc<wgpu_core::binding_model::BindGroupLayout>` to implement `Sync`
note: required because it appears within the type `ManuallyDrop<Arc<wgpu_core::binding_model::BindGroupLayout>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/manually_drop.rs:157:12
    |
157 | pub struct ManuallyDrop<T: ?Sized> {
    |            ^^^^^^^^^^^^
note: required because it appears within the type `MaybeUninit<Arc<wgpu_core::binding_model::BindGroupLayout>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/maybe_uninit.rs:241:11
    |
241 | pub union MaybeUninit<T> {
    |           ^^^^^^^^^^^
    = note: required because it appears within the type `[MaybeUninit<Arc<wgpu_core::binding_model::BindGroupLayout>>; 8]`
note: required because it appears within the type `arrayvec::arrayvec::ArrayVec<Arc<wgpu_core::binding_model::BindGroupLayout>, 8>`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrayvec-0.7.6/src/arrayvec.rs:43:12
    |
43  | pub struct ArrayVec<T, const CAP: usize> {
    |            ^^^^^^^^
note: required because it appears within the type `wgpu_core::binding_model::PipelineLayout`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/binding_model.rs:660:12
    |
660 | pub struct PipelineLayout {
    |            ^^^^^^^^^^^^^^
    = note: required for `Arc<wgpu_core::binding_model::PipelineLayout>` to implement `Sync`
note: required because it appears within the type `wgpu_core::pipeline::RenderPipeline`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/pipeline.rs:578:12
    |
578 | pub struct RenderPipeline {
    |            ^^^^^^^^^^^^^^
    = note: required for `std::sync::Weak<wgpu_core::pipeline::RenderPipeline>` to implement `Sync`
note: required because it appears within the type `wgpu_core::binding_model::ExclusivePipeline`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/binding_model.rs:478:17
    |
478 | pub(crate) enum ExclusivePipeline {
    |                 ^^^^^^^^^^^^^^^^^
    = note: required for `OnceLock<wgpu_core::binding_model::ExclusivePipeline>` to implement `Sync`
note: required because it appears within the type `wgpu_core::binding_model::BindGroupLayout`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/binding_model.rs:508:12
    |
508 | pub struct BindGroupLayout {
    |            ^^^^^^^^^^^^^^^
    = note: required for `Arc<wgpu_core::binding_model::BindGroupLayout>` to implement `Send`
note: required because it appears within the type `wgpu_core::binding_model::BindGroup`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/binding_model.rs:908:12
    |
908 | pub struct BindGroup {
    |            ^^^^^^^^^
    = note: required for `Arc<wgpu_core::binding_model::BindGroup>` to implement `Send`
note: required because it appears within the type `PhantomData<Arc<wgpu_core::binding_model::BindGroup>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:753:12
    |
753 | pub struct PhantomData<T: ?Sized>;
    |            ^^^^^^^^^^^
note: required because it appears within the type `alloc::raw_vec::RawVec<Arc<wgpu_core::binding_model::BindGroup>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:76:19
    |
76  | pub(crate) struct RawVec<T, A: Allocator = Global> {
    |                   ^^^^^^
note: required because it appears within the type `Vec<Arc<wgpu_core::binding_model::BindGroup>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:397:12
    |
397 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    |            ^^^
note: required because it appears within the type `wgpu_core::track::stateless::StatelessTracker<wgpu_core::binding_model::BindGroup>`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/track/stateless.rs:8:19
    |
8   | pub(crate) struct StatelessTracker<T> {
    |                   ^^^^^^^^^^^^^^^^
note: required because it appears within the type `wgpu_core::track::Tracker`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/track/mod.rs:600:19
    |
600 | pub(crate) struct Tracker {
    |                   ^^^^^^^
note: required because it appears within the type `wgpu_core::device::queue::EncoderInFlight`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/device/queue.rs:266:19
    |
266 | pub(crate) struct EncoderInFlight {
    |                   ^^^^^^^^^^^^^^^
note: required because it appears within the type `PhantomData<wgpu_core::device::queue::EncoderInFlight>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:753:12
    |
753 | pub struct PhantomData<T: ?Sized>;
    |            ^^^^^^^^^^^
note: required because it appears within the type `alloc::raw_vec::RawVec<wgpu_core::device::queue::EncoderInFlight>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:76:19
    |
76  | pub(crate) struct RawVec<T, A: Allocator = Global> {
    |                   ^^^^^^
note: required because it appears within the type `Vec<wgpu_core::device::queue::EncoderInFlight>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:397:12
    |
397 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    |            ^^^
note: required because it appears within the type `wgpu_core::device::life::ActiveSubmission`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/device/life.rs:24:8
    |
24  | struct ActiveSubmission {
    |        ^^^^^^^^^^^^^^^^
note: required because it appears within the type `PhantomData<wgpu_core::device::life::ActiveSubmission>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:753:12
    |
753 | pub struct PhantomData<T: ?Sized>;
    |            ^^^^^^^^^^^
note: required because it appears within the type `alloc::raw_vec::RawVec<wgpu_core::device::life::ActiveSubmission>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:76:19
    |
76  | pub(crate) struct RawVec<T, A: Allocator = Global> {
    |                   ^^^^^^
note: required because it appears within the type `Vec<wgpu_core::device::life::ActiveSubmission>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:397:12
    |
397 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    |            ^^^
note: required because it appears within the type `wgpu_core::device::life::LifetimeTracker`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/device/life.rs:137:19
    |
137 | pub(crate) struct LifetimeTracker {
    |                   ^^^^^^^^^^^^^^^
    = note: required for `Mutex<RawMutex, LifetimeTracker>` to implement `Send`
note: required because it appears within the type `wgpu_core::lock::vanilla::Mutex<wgpu_core::device::life::LifetimeTracker>`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/lock/vanilla.rs:16:12
    |
16  | pub struct Mutex<T>(parking_lot::Mutex<T>);
    |            ^^^^^
note: required because it appears within the type `wgpu_core::device::queue::Queue`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/device/queue.rs:41:12
    |
41  | pub struct Queue {
    |            ^^^^^
    = note: required for `std::sync::Weak<wgpu_core::device::queue::Queue>` to implement `Send`
    = note: 1 redundant requirement hidden
    = note: required for `OnceLock<std::sync::Weak<wgpu_core::device::queue::Queue>>` to implement `Send`
note: required because it appears within the type `wgpu_core::device::resource::Device`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/device/resource.rs:59:12
    |
59  | pub struct Device {
    |            ^^^^^^
    = note: required for `Arc<wgpu_core::device::resource::Device>` to implement `Sync`
note: required because it appears within the type `wgpu_core::binding_model::BindGroup`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/binding_model.rs:908:12
    |
908 | pub struct BindGroup {
    |            ^^^^^^^^^
    = note: required for `std::sync::Weak<wgpu_core::binding_model::BindGroup>` to implement `Send`
note: required because it appears within the type `PhantomData<std::sync::Weak<wgpu_core::binding_model::BindGroup>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:753:12
    |
753 | pub struct PhantomData<T: ?Sized>;
    |            ^^^^^^^^^^^
note: required because it appears within the type `alloc::raw_vec::RawVec<std::sync::Weak<wgpu_core::binding_model::BindGroup>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:76:19
    |
76  | pub(crate) struct RawVec<T, A: Allocator = Global> {
    |                   ^^^^^^
note: required because it appears within the type `Vec<std::sync::Weak<wgpu_core::binding_model::BindGroup>>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:397:12
    |
397 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    |            ^^^
note: required because it appears within the type `wgpu_core::weak_vec::WeakVec<wgpu_core::binding_model::BindGroup>`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/weak_vec.rs:8:19
    |
8   | pub(crate) struct WeakVec<T> {
    |                   ^^^^^^^
note: required because it appears within the type `wgpu_core::resource::DestroyedBuffer`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/resource.rs:781:12
    |
781 | pub struct DestroyedBuffer {
    |            ^^^^^^^^^^^^^^^
note: required because it appears within the type `wgpu_core::device::queue::TempResource`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/device/queue.rs:254:10
    |
254 | pub enum TempResource {
    |          ^^^^^^^^^^^^
note: required because it appears within the type `PhantomData<wgpu_core::device::queue::TempResource>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:753:12
    |
753 | pub struct PhantomData<T: ?Sized>;
    |            ^^^^^^^^^^^
note: required because it appears within the type `alloc::raw_vec::RawVec<wgpu_core::device::queue::TempResource>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:76:19
    |
76  | pub(crate) struct RawVec<T, A: Allocator = Global> {
    |                   ^^^^^^
note: required because it appears within the type `Vec<wgpu_core::device::queue::TempResource>`
   --> /home/schneider/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:397:12
    |
397 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    |            ^^^
note: required because it appears within the type `wgpu_core::device::queue::PendingWrites`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/device/queue.rs:298:19
    |
298 | pub(crate) struct PendingWrites {
    |                   ^^^^^^^^^^^^^
    = note: required for `Mutex<RawMutex, PendingWrites>` to implement `Sync`
note: required because it appears within the type `wgpu_core::lock::vanilla::Mutex<wgpu_core::device::queue::PendingWrites>`
   --> /home/schneider/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-24.0.0/src/lock/vanilla.rs:16:12
    |
16  | pub struct Mutex<T>(parking_lot::Mutex<T>);
    |            ^^^^^
    = note: the full name for the type has been written to '/home/schneider/Dropbox/burn-guide/target/release/deps/burn_guide-2c2014b614557dfe.long-type-16600178113547706552.txt'
    = note: consider using `--verbose` to print the full type name to the console

For more information about this error, try `rustc --explain E0275`.
error: could not compile `burn-guide` (bin "burn-guide") due to 1 previous error

I'm able to compile in development mode just fine (here's the config.json and experiment.log files for reference in this case).

@laggui
Copy link
Member

laggui commented Jan 28, 2025

Ahh right, we've seen this issue with the update to wgpu 0.24 that has more complex types. It can be solved by increasing the default recursion limit (128) at the top of your program:

#![recursion_limit = "256"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants