Hello @ptrblck,
I built libtorch from source with tag v1.6.0.
If the caller program does not trigger CUDA, i.e. device = torch::Device(torch::kCPU);, then myMNIST->to(device) is a no-op.
And the caller program finishes without an issue.
Let me call the caller program main and the MNIST library libmodule.so. I have google tests built along side of libmodule.so and all the tests including ones engaging CUDA pass.
main build script links with -lmodule. I wonder whether main is built with different libstdc++ (and/or other runtime libraries) from what libmodule.so is built upon. So far, I can’t verify such theory yet.
Would you please suggest anything else?