This is likely the CUDA initialization. PyTorch comes with a relatively large number of kernels and CUDA does something with them on startup. This is particularly difficult on more constrained platforms like the Jetson.
I thought of patching PyTorch to load all kernels through nvrtc instead of linking them into PyTorch but it is quite a bit of work and I was hoping someone else would fix things instead (with the recent split of libtorch_cuda, it seems people are digging in various directions there even if we’re not there yet).
Best regards
Thomas