NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running

(base) weidawang@weidawang-TUF-Gaming-FX506LU-FX506LU:~$ sudo dkms install -m nvidia -v 455.45.01
Module nvidia/455.45.01 already installed on kernel 5.4.0-56-generic/x86_64
(base) weidawang@weidawang-TUF-Gaming-FX506LU-FX506LU:~$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
(base) weidawang@weidawang-TUF-Gaming-FX506LU-FX506LU:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:24:38_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89
(base) weidawang@weidawang-TUF-Gaming-FX506LU-FX506LU:~$ whereis nvidia
nvidia: /usr/lib/x86_64-linux-gnu/nvidia /usr/lib/nvidia /usr/share/nvidia /usr/src/nvidia-455.45.01/nvidia
(base) weidawang@weidawang-TUF-Gaming-FX506LU-FX506LU:~$ dkms status
ashmem_xdroid, 1.0, 5.4.0-52-generic, x86_64: installed
ashmem_xdroid, 1.0, 5.4.0-53-generic, x86_64: installed
ashmem_xdroid, 1.0, 5.4.0-56-generic, x86_64: built
binder_xdroid, 1.0, 5.4.0-52-generic, x86_64: installed
binder_xdroid, 1.0, 5.4.0-53-generic, x86_64: installed
binder_xdroid, 1.0, 5.4.0-56-generic, x86_64: installed
nvidia, 455.45.01, 5.4.0-56-generic, x86_64: installed
(base) weidawang@weidawang-TUF-Gaming-FX506LU-FX506LU:~$ uname -r
5.4.0-56-generic
(base) weidawang@weidawang-TUF-Gaming-FX506LU-FX506LU:~/Repo/mmaction2/tools$ sudo apt-get install linux-headers-$(uname -r)
[sudo] weidawang 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
linux-headers-5.4.0-56-generic 已经是最新版 (5.4.0-56.62~18.04.1)。
linux-headers-5.4.0-56-generic 已设置为手动安装。
下列软件包是自动安装的并且现在不需要了:
  cmake-data cuda-command-line-tools-10-2 cuda-compiler-10-2 cuda-cudart-10-2 cuda-cudart-dev-10-2 cuda-cufft-10-2 cuda-cufft-dev-10-2 cuda-cuobjdump-10-2 cuda-cupti-10-2
  cuda-cupti-dev-10-2 cuda-curand-10-2 cuda-curand-dev-10-2 cuda-cusolver-10-2 cuda-cusolver-dev-10-2 cuda-cusparse-10-2 cuda-cusparse-dev-10-2 cuda-documentation-10-2 cuda-driver-dev-10-2
  cuda-gdb-10-2 cuda-libraries-10-2 cuda-libraries-dev-10-2 cuda-license-10-2 cuda-memcheck-10-2 cuda-misc-headers-10-2 cuda-npp-10-2 cuda-npp-dev-10-2 cuda-nsight-10-2
  cuda-nsight-compute-10-2 cuda-nsight-systems-10-2 cuda-nvcc-10-2 cuda-nvdisasm-10-2 cuda-nvgraph-10-2 cuda-nvgraph-dev-10-2 cuda-nvjpeg-10-2 cuda-nvjpeg-dev-10-2 cuda-nvml-dev-10-2
  cuda-nvprof-10-2 cuda-nvprune-10-2 cuda-nvrtc-10-2 cuda-nvrtc-dev-10-2 cuda-nvtx-10-2 cuda-nvvp-10-2 cuda-samples-10-2 cuda-sanitizer-api-10-2 cuda-toolkit-10-2 cuda-tools-10-2
  cuda-visual-tools-10-2 freeglut3 freeglut3-dev libcublas-dev libcublas10 libjsoncpp1 libnvidia-cfg1-455 libnvidia-common-455 libnvidia-decode-455 libnvidia-encode-455 libnvidia-extra-455
  libnvidia-fbc1-455 libnvidia-gl-455 libnvidia-ifr1-455 librhash0 libxmu-dev libxmu-headers libxnvctrl0 linux-headers-5.4.0-52-generic linux-hwe-5.4-headers-5.4.0-48
  linux-hwe-5.4-headers-5.4.0-52 linux-image-5.4.0-52-generic linux-modules-5.4.0-52-generic linux-modules-extra-5.4.0-52-generic nsight-compute-2020.2.1 nsight-systems-2020.3.4
  nvidia-compute-utils-455 nvidia-dkms-455 nvidia-kernel-common-455 nvidia-kernel-source-455 nvidia-modprobe nvidia-prime nvidia-settings nvidia-utils-455 screen-resolution-extra
  xserver-xorg-video-nvidia-455
使用'sudo apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 39 个软件包未被升级。

I solved by disable secure boot in the BIOS