Gadersd / stable-diffusion-xl-burn

Stable Diffusion XL ported to Rust's burn framework
MIT License
248 stars 15 forks source link

Windows user with CUDA 12.2 => panicking while loading diffuser #7

Closed Cyril-Cf closed 11 months ago

Cyril-Cf commented 11 months ago

I'm trying to reproduce the example provided. Everything is downloaded and ready, but I can't seem to make it work. My Rust version is 1.71.1. Here's what I get in my windows powershell :

thread 'main' panicked at 'called Result::unwrap() on an Err value: Unknown("Unable to load record.\nError: Unknown(\"Io { inner: Error { kind: UnexpectedEof, message: \\"failed to fill whole buffer\\" }, additional: 2 }\")")', src\bin\sample\main.rs:113:70

stack backtrace: 0: 0x7ff61c56ffec - std::sys_common::backtrace::_print::impl$0::fmt at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\sys_common\backtrace.rs:44 1: 0x7ff61c58831b - core::fmt::rt::Argument::fmt at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\fmt\rt.rs:138 2: 0x7ff61c58831b - core::fmt::write at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\fmt\mod.rs:1094 3: 0x7ff61c56d759 - std::io::Write::write_fmt at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\io\mod.rs:1713 4: 0x7ff61c56fd9b - std::sys_common::backtrace::_print at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\sys_common\backtrace.rs:47 5: 0x7ff61c56fd9b - std::sys_common::backtrace::print at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\sys_common\backtrace.rs:34 6: 0x7ff61c5725a9 - std::panicking::default_hook::closure$1 at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:269 7: 0x7ff61c57225f - std::panicking::default_hook at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:288 8: 0x7ff61c572aae - std::panicking::rust_panic_with_hook at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:705 9: 0x7ff61c57299d - std::panicking::begin_panic_handler::closure$0 at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:597 10: 0x7ff61c570969 - std::sys_common::backtrace::rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$> at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\sys_common\backtrace.rs:151 11: 0x7ff61c5726a0 - std::panicking::begin_panic_handler at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:593 12: 0x7ff61c5f42c5 - core::panicking::panic_fmt at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\panicking.rs:67 13: 0x7ff61c5f47d3 - core::result::unwrap_failed at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\result.rs:1651 14: 0x7ff61c3cbaa7 - <burn_tch::backend::TchBackend as stablediffusion::backend::Backend>::qkv_attention::hdbe6096db726169c 15: 0x7ff61c3da1b6 - stablediffusion::model::autoencoder::Autoencoder::decode_latent::h3e800603716f0d65 16: 0x7ff61c3da1cc - std::rt::lang_start::{{closure}}::h34430c21a9efe000 17: 0x7ff61c568368 - std::rt::lang_start_internal::closure$2 at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\rt.rs:148 18: 0x7ff61c568368 - std::panicking::try::do_call at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:500 19: 0x7ff61c568368 - std::panicking::try at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:464 20: 0x7ff61c568368 - std::panic::catch_unwind at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panic.rs:142 21: 0x7ff61c568368 - std::rt::lang_start_internal at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\rt.rs:148 22: 0x7ff61c3cda5c - main 23: 0x7ff61c5e5ba0 - invoke_main at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78 24: 0x7ff61c5e5ba0 - scrt_common_main_seh at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 25: 0x7ffdbd5d257d - BaseThreadInitThunk 26: 0x7ffdbe44aa78 - RtlUserThreadStart

Does anyone have a guess at what is going wrong?

Gadersd commented 11 months ago

My guess is that your system ran out of memory. SDXL needs about 12 GB of VRAM to run. How much CPU RAM and GPU VRAM do you have?

On Oct 7, 2023, at 7:26 AM, Cyril-Cf @.***> wrote:

I'm trying to reproduce the example provided. Everything is downloaded and ready, but I can't seem to make it work. My Rust version is 1.71.1. Here's what I get in my windows powershell :

thread 'main' panicked at 'called Result::unwrap() on an Err value: Unknown("Unable to load record.\nError: Unknown("Io { inner: Error { kind: UnexpectedEof, message: \"failed to fill whole buffer\" }, additional: 2 }")")', src\bin\sample\main.rs:113:70

stack backtrace: 0: 0x7ff61c56ffec - std::sys_common::backtrace::_print::impl$0::fmt at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\sys_common\backtrace.rs:44 1: 0x7ff61c58831b - core::fmt::rt::Argument::fmt at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\fmt\rt.rs:138 2: 0x7ff61c58831b - core::fmt::write at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\fmt\mod.rs:1094 3: 0x7ff61c56d759 - std::io::Write::write_fmtstd::sys::windows::stdio::Stderr at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\io\mod.rs:1713 4: 0x7ff61c56fd9b - std::sys_common::backtrace::_print at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\sys_common\backtrace.rs:47 5: 0x7ff61c56fd9b - std::sys_common::backtrace::print at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\sys_common\backtrace.rs:34 6: 0x7ff61c5725a9 - std::panicking::default_hook::closure$1 at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:269 7: 0x7ff61c57225f - std::panicking::default_hook at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:288 8: 0x7ff61c572aae - std::panicking::rust_panic_with_hook at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:705 9: 0x7ff61c57299d - std::panicking::begin_panic_handler::closure$0 at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:597 10: 0x7ff61c570969 - std::sys_common::backtrace::rust_end_short_backtracestd::panicking::begin_panic_handler::closure_env$0,never$ at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\sys_common\backtrace.rs:151 11: 0x7ff61c5726a0 - std::panicking::begin_panic_handler at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:593 12: 0x7ff61c5f42c5 - core::panicking::panic_fmt at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\panicking.rs:67 13: 0x7ff61c5f47d3 - core::result::unwrap_failed at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\result.rs:1651 14: 0x7ff61c3cbaa7 - ::qkv_attention::hdbe6096db726169c 15: 0x7ff61c3da1b6 - stablediffusion::model::autoencoder::Autoencoder::decode_latent::h3e800603716f0d65 16: 0x7ff61c3da1cc - std::rt::lang_start::{{closure}}::h34430c21a9efe000 17: 0x7ff61c568368 - std::rt::lang_start_internal::closure$2 at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\rt.rs:148 18: 0x7ff61c568368 - std::panicking::try::do_call at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:500 19: 0x7ff61c568368 - std::panicking::try at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:464 20: 0x7ff61c568368 - std::panic::catch_unwind at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panic.rs:142 21: 0x7ff61c568368 - std::rt::lang_start_internal at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\rt.rs:148 22: 0x7ff61c3cda5c - main 23: 0x7ff61c5e5ba0 - invoke_main at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78 24: 0x7ff61c5e5ba0 - scrt_common_main_seh at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 25: 0x7ffdbd5d257d - BaseThreadInitThunk 26: 0x7ffdbe44aa78 - RtlUserThreadStart

Does anyone have a guess at what is going wrong?

— Reply to this email directly, view it on GitHub https://github.com/Gadersd/stable-diffusion-xl-burn/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7COZR2TGRLGVJJ45V3LCDX6E367AVCNFSM6AAAAAA5W3S7NCVHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZTCMZRGM2DOMI. You are receiving this because you are subscribed to this thread.

Cyril-Cf commented 11 months ago

I have a Geforce RTX 4090 with 24Go RAM and 64Go CPU RAM, I thought my PC could handle that pretty well. I don't know what to try :'(

Gadersd commented 11 months ago

It might be that your diffuser model file is corrupted. Run

sha256sum diffuser.bin

The hash should be 072267569927227fbbb936de88225cdc5cfd184da9ff0337b611f0e3c9b246db if the file is uncorrupted.