Thanks for the update! The error sounds like a setup issue, as it seems to be created during the first CUDA operation.
Try to restart your machine (especially after e.g. a driver update) and rerun the code.
If it’s still failing, reinstall the driver as well as the PyTorch binaries, and recheck it again.
Before doing these steps, you could also try to run your workload in a docker container and check, if this CUDA setup would work.