Nvcc fatal : Unsupported gpu architecture 'compute_86'

While I am trying to compile YOLOv4 I am getting this error. I checked cudnn and it is working. Cuda files and paths are OK. I can even train other deep learning models on GPU. I checked other topics but the answers could not solve my problem. How can I solve this error?

System Info:
RTX 3060, Ubuntu 20.04

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02    Driver Version: 470.57.02    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   51C    P8    15W / 170W |     10MiB / 12053MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1199      G   /usr/lib/xorg/Xorg                  4MiB |
|    0   N/A  N/A      1977      G   /usr/lib/xorg/Xorg                  4MiB |
+-----------------------------------------------------------------------------+
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR
#define CUDNN_MAJOR 8
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)

Problem solved. python - Nvcc fatal : Unsupported gpu architecture ‘compute_86’ - Stack Overflow