Runtime error when testing out torchvision C++ frontend

So I was following https://github.com/pytorch/vision/tree/master/examples/cpp/hello_world to test out the C++ frontend for torchvision. Compilation was successful with cmake.

But when I run ./hello-world I got a error while loading shared libraries: libc10_cuda.so: cannot open shared object file: No such file or directory, and I checked I do have libc10_cuda.so under path/to/libtorch/lib. I’m on ubuntu 20.04 with torch 1.6, cuda 10.2 and gcc 9.3.

What would be a likely cause for this error?

solved by export LD_LIBRARY_PATH=absolute/path/to/libtorch/lib