You won’t be able to change the local CUDA toolkit easily. The PyTorch binaries ship with their own CUDA runtime so unless you are building PyTorch from source or a custom CUDA extension the local CUDA toolkit won’t be used.