-
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
Release mode cannot find cuda #489
Comments
@dbsxdbsx Had the same issue. After some searching on the repo, realised this is a duplicate of #291. The solution, as per #291 (comment), is to add tch::maybe_init_cuda(); before you try to create a |
@RundownRhino , thanks your advice. After putting let device = loop {
let cur_index = get_usize_num_from_user_input_str();
match cur_index {
1 => break tch::Device::cuda_if_available(),
2 => break tch::Device::Cpu,
3 => {
tch::maybe_init_cuda(); // modified here
break tch::Device::Cuda(0);
}
_ => println!("error input"),
}
}; I am wondering why |
|
On Win10 with cuda 11.3, and tch-rs 0.7.2 and torchlib 1.11.0_cuda11.3 of release version, when calling
tch::Device::cuda_if_available(),
in release mode, it turns to using cpu. If it is forced to using cuda by callingtch::Device::Cuda(0)
, then it runs into error.The text was updated successfully, but these errors were encountered: