Hi,
Regarding nvcc, please add the following environment variable and try it again.
$ export PATH=/usr/local/cuda-11.4/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH
For PyTorch, please install our prebuilt to get the CUDA support.
You can find it in the below link:
Thanks.