Pytorch in cuda mode use huge memory

Also, please refer to this post: https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-9-0-now-available/72048/843

this doesn’t seem specific to Jetson, as using CUDA in PyTorch also uses extra memory on PC/x86. I believe it is loading compiled CUDA kernel code binaries and libraries like cuDNN. If you have swap mounted, it seems that much of it can be swapped out in my experience.