NVIDIA GeForce RTX 3050 Ti Laptop GPU with CUDA capability sm_86 is not compatible with the current PyTorch installation

You are most likely installing a PyTorch pip wheel or conda binary with the CUDA 10.2 runtime.
Note that your locally installed CUDA toolkit would only be used if you are building PyTorch from source or a custom CUDA extension.