-
Notifications
You must be signed in to change notification settings - Fork 352
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
Cuda not available in cargo run --release (BUG)? #291
Comments
It seem Cuda becomes disabled when running anything above An even simpler example extern crate tch;
use anyhow::Result;
pub fn main() -> Result<()> {
println!("{:?}", tch::Device::cuda_if_available());
println!("{:?}", tch::Cuda::cudnn_is_available());
Ok(())
} cargo run
cargo run --release
|
Thanks for reporting this. |
@LaurentMazare it seems EDIT: Nevermind, didn't have to mess with the linker at all. Just had to EDIT 2: For those reading this, you don't actually have to manually expose such a function through |
Ah glad that you were able to get this to work, it's annoying that this bit is optimized away in release mode. |
I see that |
Yes there will be a better solution once |
A simple script that loads an image and moves it to cuda if available, only moves to "cuda"
I present a simple script to test this.
when using
cargo run --release
only cpu is available.but when running
cargo run
cuda is availalbe.The text was updated successfully, but these errors were encountered: