如何在 Manjaro 18 中安装 Nvidia 驱动程序?

如何在 Manjaro 18 中安装 Nvidia 驱动程序?

今天,我在配备 GeForce GTX 850M 的 MSI GE-60PC 笔记本电脑上安装了最新版本的 Manjaro i3 18.0.3。我正在使用带有外部显示器(通过 HDMI 连接)的笔记本电脑。第一次启动后,我的笔记本电脑屏幕和外接显示器被镜像。我无法设置我的显示设置。然后我安装了nvidia包1通过以下命令使用 pacman。

sudo pacman -S linux419-nvidia

我的内核版本是;

Linux my-msi 4.19.28-1-MANJARO #1 SMP PREEMPT Sun Mar 10 08:32:42 UTC 2019 x86_64 GNU/Linux

1, 它说;

5. Reboot. The nvidia package contains a file which blacklists the nouveau module, so rebooting is necessary. 

因此,我在安装 nvidia 驱动程序后重新启动了电脑。重新启动后,我的显示设置被修复,因此我的显示器被扩展。虽然,当我运行以下命令时;

lspci -k | grep -A 2 -E "(VGA|3D)"
0:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
    DeviceName:  Onboard IGD
    Subsystem: Micro-Star International Co., Ltd. [MSI] 4th Gen Core Processor Integrated Graphics Controller
--
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 850M] (rev a2)
    Subsystem: Micro-Star International Co., Ltd. [MSI] GM107M [GeForce GTX 850M]
    Kernel driver in use: nouveau

它说我仍在使用 nouveau 驱动程序。安装 nvidia 驱动程序的正确方法是什么?之后我想安装cuda和pytorch。

当我运行 nvidia-modprobe 命令时,会出现以下内核日志。

[ 1883.794671] nvidia-nvlink: Nvlink Core is being initialized, major device number 237
[ 1883.795017] NVRM: The NVIDIA probe routine was not called for 1 device(s).
[ 1883.795018] NVRM: This can occur when a driver such as: 
               NVRM: nouveau, rivafb, nvidiafb or rivatv 
               NVRM: was loaded and obtained ownership of the NVIDIA device(s).
[ 1883.795018] NVRM: Try unloading the conflicting kernel module (and/or
               NVRM: reconfigure your kernel without the conflicting
               NVRM: driver(s)), then try loading the NVIDIA kernel module
               NVRM: again.
[ 1883.795018] NVRM: No NVIDIA graphics adapter probed!
[ 1883.795132] nvidia-nvlink: Unregistered the Nvlink Core, major device number 237

答案1

类似问题:https://bbs.archlinux.org/viewtopic.php?id=213042 尝试将以下模块列入黑名单并重新启动:

blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
blacklist nv
blacklist uvcvideo

答案2

您可以从以下位置下载 NVIDIA Linux 驱动程序这里。下载完成后,运行

sudo init 3

这将带您进入没有桌面环境的多用户环境。现在,在 NVIDIA 驱动程序目录中输入您的用户名和密码,cd然后运行以下命令来安装驱动程序:

sudo ./nvidia-driver-name

完成后,运行:

sudo init 5

将出现桌面环境。我希望这能解决您的问题。

相关内容