I have a few Windows C++ executables, some of which use LibTorch with CUDA to run TorchScript models. I’d like to run them on a Linux server with an NVIDIA GPU, with exactly the same results as on Windows. Is recompiling the sources on Linux with CMake + LibTorch the best approach, or is there a better alternative? What are the common pitfalls?
Yes, I believe recompiling the code on a Linux system is the right approach (the other way around you could have tried WSL2). Code paths might slightly differ depending on the model architecture. However, before digging into the actual execution I would recommend making sure all compute libraries are at the same version.