You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 16.04 LTS安装nvidia-396驱动后出现登录循环问题求助

解决nvidia-396驱动导致的登录循环问题

Hey there, sorry to hear you're stuck in that frustrating login loop after installing the nvidia-396 driver—been there, done that, and it’s a real headache. Let’s walk through the most likely fixes, step by step.

第一步:先切换到TTY终端

When you hit the login loop, don’t panic. Press Ctrl+Alt+F3 (or any F key from F2 to F6) to switch to a text-only terminal. Log in with your username and password—this is where we’ll do all the troubleshooting.

方案1:修复用户权限问题

Sometimes the loop happens because your user doesn’t have proper permissions for Xorg-related files. Let’s check and fix that:

  • First, list the ownership of critical files:
    ls -l ~/.Xauthority ~/.ICEauthority
  • If either file shows root as the owner instead of your username, run this to fix permissions:
    sudo chown $USER:$USER ~/.Xauthority ~/.ICEauthority
  • Now restart the display manager to test:
    sudo systemctl restart lightdm
    If this works, you should be able to switch back to the graphical login (Ctrl+Alt+F1) and log in normally.

方案2:彻底清理并重新安装驱动

If permissions aren’t the issue, the problem is likely a corrupted driver installation or conflicting Xorg configs. Let’s start fresh:

  1. Purge all existing NVIDIA components (you did this already, but we’ll make sure nothing’s left):
    sudo apt purge nvidia-* nvidia* libnvidia*
    sudo apt autoremove && sudo apt autoclean
  2. Remove old Xorg config files that might be causing conflicts:
    sudo rm /etc/X11/xorg.conf (ignore the error if the file doesn’t exist)
  3. Reinstall the nvidia-396 driver using the official repositories:
    sudo apt update
    sudo apt install nvidia-396 nvidia-settings
  4. Generate a fresh Xorg config tailored to your GPU:
    sudo nvidia-xconfig
  5. Reboot your system to apply changes:
    sudo systemctl reboot

方案3:检查Secure Boot设置

Modern systems with Secure Boot enabled can block unsigned NVIDIA drivers from loading, which breaks the graphical session. Here’s how to fix it:

  1. Reboot your computer and enter BIOS/UEFI settings (usually by pressing Del, F2, or F10 during boot).
  2. Look for the "Secure Boot" option and disable it.
  3. Save changes and boot back into your system, then repeat the driver reinstall steps above.

方案4:匹配内核版本

NVIDIA 396 is an older driver, so it might not support newer Linux kernels. Let’s check if your kernel is too new:

  • First, check your current kernel version:
    uname -r
  • If your kernel is 5.4 or newer, nvidia-396 might not be compatible. You’ll need to install an older kernel that’s supported:
    1. Install a compatible kernel (e.g., 4.15.x, which works well with 396):
      sudo apt install linux-image-4.15.0-197-generic linux-headers-4.15.0-197-generic
    2. Reboot your system, and when the GRUB menu appears, select "Advanced options for Ubuntu" > choose the 4.15 kernel.
    3. Once logged in, reinstall the nvidia-396 driver as outlined in方案2.

If none of these work, feel free to share more details like your GPU model, Ubuntu version, and any error messages you see in /var/log/Xorg.0.log—that’ll help narrow things down further.

内容的提问来源于stack exchange,提问作者devansdev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:19:26