Oh, I just found out why it didn’t work: Building pytorch with Visual Studio + CUDA apparently requires the Cuda Visual Studio Integration to be installed. So I re-ran the CUDA installer and checked the appropriate box and now the build is running. Hope that this might help other too.