(解决)NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver.回退系统内核版本

1. 问题描述

今天跑程序时,像往常一样输入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.

经检索,利用一篇博文中的方法可解决大多数人的问题。遇到相同问题的,还没试过的可以试试:
https://blog.csdn.net/wjinjie/article/details/108997692
我试了之后,报了如下错误:

Error! Could not find module source directory.

咋办嘞,继续查原因吧,发现是系统内核自动更新,回退系统内核版本,以下是主要步骤:

2. 回退系统内核版本

2.1 查看当前系统内核