Open luxiant opened 2 months ago
for me it was an extra "include" and "torch" if you have a trailing one export LIBTORCH_INCLUDE=/home/bion/hax/externals/pytorch/torch/csrc/api no trailing /include because the build.rs might add that path part again non-idempotently
for autograd stuff, the issue could be they are in separate areas of the torch directory tree
(py310) [2024-05-24T08:29:36-0400] ~/hax/externals/pytorch/torch (main) $
fd engine.h csrc/autograd/engine.h csrc/autograd/python_engine.h csrc/distributed/autograd/engine/dist_engine.h (py310) [2024-05-24T08:29:46-0400] ~/hax/externals/pytorch/torch (main) $ fd torch.h csrc/api/include/torch/torch.h
if we only "include" /api/include/ then we're missing the /autograd/
sadly the build script isn't working right now with latest pytorch i guess, this line linked above might need to also include the
/pytorch/torch/csrc/autograd/
ugh i could try it locally
I only set two variables like this
export LIBTORCH=/home/test/libtorch
export LD_LIBRARY_PATH=/home/test/libtorch/lib/:$LD_LIBRARY_PATH
and it works.
This is all I've done in terminal
Then I made a rust-bert project that requires tch-rs. Here is the error when I do cargo run of this project.
There must be something wrong when setting environment variables, but I can't figure out. Can you help with this?