mlverse / lantern

C Interface to Torch
5 stars 0 forks source link

libtorch cmake issues #11

Open skeydan opened 4 years ago

skeydan commented 4 years ago

Compiling lantern for with cuda, I encounter a subset of the things described in

https://github.com/mlverse/torch/issues/3

This really is due to

https://discuss.pytorch.org/t/libtorch-cmake-issues/28246/7

The workaround is adding the 4th line of those (the others i had already)

export CUDNN_INCLUDE_DIR=/usr/include/cuda
export TORCH_BACKEND=CUDA
export CUDA_HOME=/usr
export CUDA_TOOLKIT_ROOT_DIR=/usr

and between cmake and cmake -- build, remove these two lines from build.make:

liblantern.so: /usr/local/cuda/lib64/libnvToolsExt.so
liblantern.so: /usr/local/cuda/lib64/libcudart.so
dfalbel commented 4 years ago

I don't think you need to compile lanter specifically for cuda. It loads libtorch dynamically, and in theory it doesnt need to know about how libtorch does the computations..