安装 nvidia 驱动后,Ubuntu 18.04 在登录页面后挂起

安装 nvidia 驱动后,Ubuntu 18.04 在登录页面后挂起

我刚刚在 ASUS Zenbook UX303L 上安装了 Ubuntu 18.04。安装 nvadia 显卡并重新启动后,输入我的凭据后无法进入登录页面。

我使用这些命令来安装 nvidia 显卡驱动程序

sudo add-apt-repository ppa:graphics-drivers/ppa 
sudo apt-get update
sudo apt-get install nvidia-390

以下是我尝试过的一些解决方案。

1) 进入 TTY 终端并重新安装 nvidia 显卡驱动程序。由于这些错误,我无法执行此操作当我尝试通过 TTY 调试时输出。我基本上对 TTY 无能为力,因为我无法执行任何事情。

密码登录后挂起

2)在 GRUB 页面上安装 Ubuntu 和 Nvidia 驱动程序,按下并添加nouveau.modeset=0到 linux 行和 F10 的末尾。

3) 我使用 GRUB 菜单上的高级选项加载了旧内核版本。登录屏幕后我仍然卡住。

还是没运气。现在我很困惑到底是我的显卡还是内核的问题。有什么想法我应该怎么做吗?任何帮助我都会很感激。

这是我的系统信息(我通过使用 USB 启动获得此信息,因为我不想重新安装 Ubuntu。)

ubuntu@ubuntu:~$ inxi -Fx System: Host: ubuntu Kernel: 4.15.0-29-generic x86_64 bits: 64 compiler: gcc v: 7.3.0 Desktop: Gnome 3.28.2 Distro: Ubuntu 18.04.1 LTS (Bionic Beaver) Machine: Type: Laptop System: ASUSTeK product: UX303LNB v: 1.0 serial: <root required> Mobo: ASUSTeK model: UX303LNB v: 1.0 serial: <root required> UEFI: American Megatrends v: UX303LNB.203 date: 12/10/2014 Battery: ID-1: BAT0 charge: 22.9 Wh condition: 40.3/50.1 Wh (80%) model: ASUSTeK ASUS Battery status: Discharging CPU: Topology: Dual Core model: Intel Core i7-5500U bits: 64 type: MT MCP arch: Broadwell rev: 4 L2 cache: 4096 KiB flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 19154 Speed: 1400 MHz min/max: 500/3000 MHz Core speeds (MHz): 1: 1400 2: 1397 3: 1397 4: 1397 Graphics: Device-1: Intel HD Graphics 5500 vendor: ASUSTeK driver: i915 v: kernel bus ID: 00:02.0 Device-2: NVIDIA GM108M [GeForce 840M] vendor: ASUSTeK driver: nouveau v: kernel bus ID: 03:00.0 Display: x11 server: X.Org 1.19.6 driver: nouveau resolution: 3200x1800~60Hz Message: Unable to show advanced data. Required tool glxinfo missing. Audio: Device-1: Intel Broadwell-U Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel bus ID: 00:03.0 Device-2: Intel Wildcat Point-LP High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel bus ID: 00:1b.0 Sound Server: ALSA v: k4.15.0-29-generic ^ANetwork: Device-1: Intel Wireless 7265 driver: iwlwifi v: kernel port: f040 bus ID: 02:00.0 IF: wlp2s0 state: down mac: 60:57:18:3d:ed:0c Device-2: ASIX AX88772B type: USB driver: asix bus ID: 1-3:6 IF: enx9cebe81d1999 state: up speed: 100 Mbps duplex: full mac: 9c:eb:e8:1d:19:99 Drives: Local Storage: total: 503.04 GiB used: 406.9 MiB (0.1%) ID-1: /dev/sda vendor: HGST (Hitachi) model: HTS545050B7E660 size: 465.76 GiB ID-2: /dev/sdb vendor: Kingston model: SMSM150S324G2 size: 22.37 GiB ID-3: /dev/sdc type: USB vendor: SanDisk model: Cruzer Switch size: 14.91 GiB Partition: ID-1: / size: 3.85 GiB used: 406.9 MiB (10.3%) fs: overlay source: ERR-102 Sensors: Missing: Required tool sensors not installed. Check --recommends Info: Processes: 221 Uptime: 8m Memory: 7.70 GiB used: 1.25 GiB (16.2%) Init: systemd runlevel: 5 Compilers: gcc: N/A Shell: bash v: 4.4.19 inxi: 3.0.30

答案1

我使用专有驱动程序设置 NVIDIA 显卡的经验:

  1. https://www.geforce.com/drivers并为您的 GPU 下载最新的 Linux 64 位驱动程序(选择最新版本,410.93 是最新的)
  2. 在恢复模式下重新启动笔记本电脑(在 GRUB 屏幕中,按“e”并在以 linux 开头的行中添加“1”,它应该是从底部开始的第二行)并按“F10”
  3. 输入 root 密码
  4. 确保“/etc/X11/”文件夹下没有“xorg.conf”
  5. 进入下载最新 NVIDIA 驱动程序的目录
  6. 以“sh ./NVIDIA-xxxxx.run”的形式运行 NVIDIA 驱动程序安装程序,并按照说明进行操作
  7. 使用“sudo nano /etc/initramfs-tools/modules”编辑文件并在单独的行中添加以下模块:nvidia、nvidia_modeset、nvidia_uvm、nvidia_drm
  8. 运行“sudo update-initramfs -c -k all”
  9. 在文件 '/etc/default/grub' 中,将内核参数 'nvidia-drm.modeset=1' 添加到以“GRUB_CMDLINE_LINUX_DEFAULT”开头的行
  10. 运行“sudo update-grub”
  11. 重启笔记本电脑并正常进入 Linux

如果您遇到编译问题,请查看 NVIDIA 安装程序日志以查找确切错误。在大多数情况下,您可能需要安装“linux-headers”(对应于您的 linux 内核版本)、“gcc”包,然后重试 NVIDIA 驱动程序安装。

相关内容