-
Notifications
You must be signed in to change notification settings - Fork 360
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
Trying to run basic examples, but I think I have some issues with my config #177
Comments
The 0.1.6 version is only compatible with PyTorch 1.4, this probably explains your compilation errors. |
Thank you for your quick answer ! :) |
Ok, I used the master tip and it works, I just had to add /lib in my path |
I'm trying to use CUDA, used the correct libtorch from website, but I encounter this issue, any idea on how to pass that ?
prints False Thanks in advance |
Right, the cuda detection and linking has become a bit messier since the 1.5 release, see [1] for some context. The main culprit is that cargo does not let you pass arbitrary flags so it is difficult to pass the |
With your update, I now have a new error :
Maybe I have a missing dll or something ? I can successfully use tensorflow on my system as well as pyTorch python with cuda 10.2 and dll 7.5 though . |
I'll be quite available this week end if you need me to test anything |
That's weird, the println!("cargo:rustc-link-lib=c10_cuda"); It doesn't seem likely to help but worth trying when you get a chance. |
I just tried this :
and got this result :
|
Thanks, that's sadly the same error as previously, I can see the symbol being exported by torch_cuda.lib using winedump but the linker doesn't seem to pick this up - I'm afraid I don't know enough about the windows linker to be helpful here. |
Ok, I'll try to work on the CPU for now, thanks for trying, if I find something I'll let you know. Thank you again and have a great day ! |
I was able to get access to a win+nvidia box and was getting the same error as you did when using cuda. I just pushed some changes that should hopefully fix the issue (at least they worked on this box), let me know if this still doesn't work for you. |
Wow thank you a lot ! It indeed prints
:) I just have to manage to specify GPU for your MNIST example, I replaced I have this error now :
On this last line :
I think I miss some device specifications somewhere. |
Haha that's was a stupid mistake, I did put train_images into train_labels ... So everything seems to work greatly ! Now I have no excuses to translate my whole python RL system to Rust. I'll keep you posted ! Thank you a lot ! :) |
Glad that it ended up working, and let me know if there is anything else that could be helpful to you. |
Yes, that's why in the first place I was interested in your repository :) I just encountered another issue though, when I run with --release I encounter the same issue as before :
Any idea ? |
Indeed it seems that symbols get stripped more aggressively in release mode on windows than they do on linux. use torch_sys::dummy_cuda_dependency();
fn main() {
unsafe{ dummy_cuda_dependency(); }
// your normal code there
} If this ends up working well for you, we can try to make this nicer, at least removing the |
Great! That indeed did the trick, do you want me to close the issue then or do you prefer making another test before ? Thank you again. |
Cool, we can probably keep this issue open until we have a less hacky way of triggering the dependency. |
That trick works indeed, thanks, but one needs to add the dependency to your torch-sys as well. Here is my basic code to test it, and print
main.rs -> extern crate tch;
use tch::Device;
fn main() {
unsafe{ torch_sys::dummy_cuda_dependency(); }
let device = Device::cuda_if_available();
println!("using {:?}", device);
} |
I think I just got hit by this but I'm on Ubuntu. I get this error :
|
Not sure to understand what your setup is: if you didn't install libtorch manually nor have set the |
Apologies, it seems like I've not been very specific and given you context. |
Closing this for now as not much has been done recently. The PR[1] allowing cargo to pass arbitrary linker flags is making slow but steady progress so hopefully the hacky bits can be removed at some point. |
Hello there :)
I wanted to give this crate a go and was attracted by the apparent simplijcity of usage.
I downloaded libtorch 1.5 from pytorch website and filled the corresponding Environment Variables
I tried to start a new cargo project and just put :
in my cargo.toml file.
I used the first main in example :
When I try to run it I encounter som compilation issue :
Do you have any idea of what I should do or what is missing on my system ?
I'm on Windows 10
using CLion with rust plugin
Thank you in advance.
Nicolas
The text was updated successfully, but these errors were encountered: