Thank you for the code! Could you upload it as a GitHub Gist, as pastebin is not accessible from the current setup (if not, I can use another machine later and check the code)?
In the meantime, could you also create a new virtual environment and install the conda binaries (not pip wheels), as I would like to check, if you are seeing an issue for sm_61 with the pip wheels in particular?



 paozaf:

I’m using the weels for 1.8.1, but my nvcc version is 11.2 (not 11.1).


The pip wheels and conda binaries ship with the CUDA runtime. Your local CUDA toolkit will only be used, if you want to build PyTorch from source or any custom CUDA extension. As long as the NVIDIA driver is suitable for the CUDA runtime (shipped in the binaries), it should work.