Driver NVIDIA falhou repentinamente (20.04 LTS)

Sep 26 2020

Eu inicializei meu laptop no Ubuntu 20.04 LTS alguns meses atrás. A instalação do Ubuntu por padrão instalou o driver NVIDIA para mim, para que eu pudesse usar perfeitamente o driver NVIDIA e o modelo treinado com GPU.

Tudo estava bem até alguns dias atrás, de repente, recebi o seguinte erro ao executar 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.

Desde então, não consegui abrir corretamente minha GUI do NVIDIA X Server, conforme anexo:

Ele também veio com outros problemas de exibição irritantes, por exemplo:

  • a iluminação de fundo da tela ainda estava ligada, embora a tela tenha ficado preta
  • a tela falhou ao retomar quando foi despertada do modo de suspensão
  • o brilho da tela não pôde ser ajustado

Todos esses problemas de exibição não aconteciam no passado, quando instalei o Ubuntu 20.04.

Quando verifiquei o Software & Update, descobri que o driver mudou estranhamente para o driver de vídeo Nouveau (conforme anexo):

Não consegui voltar para o driver NVIDIA listado acima. Sempre que tentava mudar, obtinha o seguinte erro:

Fiquei muito frustrado com o que estava acontecendo. Não fiz nenhuma atualização de software para minimizar o risco de bagunçar o driver da NVIDIA, mas ainda assim aconteceu no final ...

Em último recurso, irei reinstalar o Ubuntu, mas antes gostaria de procurar outras alternativas. Muito apreciado se você tiver soluções possíveis!

Erro ao instalar nvidia-driver-450-server

sudo apt-get install nvidia-driver-450-server

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nvidia-driver-450-server : Depends: libnvidia-gl-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: libnvidia-compute-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: libnvidia-extra-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: nvidia-compute-utils-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: libnvidia-decode-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: libnvidia-encode-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: nvidia-utils-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: xserver-xorg-video-nvidia-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: libnvidia-cfg1-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: libnvidia-ifr1-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Depends: libnvidia-fbc1-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed
                            Recommends: libnvidia-compute-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2)
                            Recommends: libnvidia-decode-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2)
                            Recommends: libnvidia-encode-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2)
                            Recommends: libnvidia-ifr1-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2)
                            Recommends: libnvidia-fbc1-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2)
                            Recommends: libnvidia-gl-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2)
E: Unable to correct problems, you have held broken packages.

Especificação de
laptop: Lenovo Legion Y740
OS: Ubuntu
20.04 Kernel: 5.4.0-48-
GPU genérico : RTX 2070 Max-Q

Respostas

4 NikolayR Sep 26 2020 at 02:05

Como solução temporária, tente inicializar a versão anterior do kernel se tudo estava bem anteriormente. No meu caso, o kernel de trabalho era 5.4.0-47 (* -48 estava quebrado). Esperançosamente, é algum problema temporário com dependências de pacote que será resolvido em breve.

Atualização: Corrigi o problema com a nova versão do kernel (5.4.0-48) por aptitude install nvidia-driver-450. Houve muitos avisos sobre alguns conflitos e remoção de pacotes nvidia - * - 440, mas finalmente a nova versão instalada e o novo kernel inicializa com drivers da nvidia e tudo parece estar bem até agora.

dPac Oct 04 2020 at 12:43

Finalmente encontrei uma solução para exatamente o mesmo problema. Reinicie no kernel 5.4.0.48 defeituoso. Agora, abra seu terminal e faça o seguinte:

  1. Corre:

    sudo apt-get dist-upgrade
    
  2. Abra o Atualizador de software e instale as novas atualizações.

  3. Reinicie e o driver NVIDIA deve funcionar novamente.