FreeBSD NVIDIA

安装

安装nvidia
pkg install nvidia-driver nvidia-drm-kmod

输出显示:

安装nvidia
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 7 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	drm-61-kmod: 6.1.92
	egl-wayland: 1.1.13
	libunwind: 20240221
	nvidia-driver: 550.120
	nvidia-drm-61-kmod: 550.120_1
	nvidia-drm-kmod: 550.120
	xorg-server: 21.1.14,1

Number of packages to be installed: 7

The process will require 310 MiB more space.

Proceed with this action? [y/N]: y
[1/7] Installing libunwind-20240221...
[1/7] Extracting libunwind-20240221: 100%
[2/7] Installing egl-wayland-1.1.13...
[2/7] Extracting egl-wayland-1.1.13: 100%
[3/7] Installing xorg-server-21.1.14,1...
[3/7] Extracting xorg-server-21.1.14,1: 100%
[4/7] Installing drm-61-kmod-6.1.92...
[4/7] Extracting drm-61-kmod-6.1.92: 100%
[5/7] Installing nvidia-driver-550.120...
[5/7] Extracting nvidia-driver-550.120: 100%
[6/7] Installing nvidia-drm-61-kmod-550.120_1...
[6/7] Extracting nvidia-drm-61-kmod-550.120_1: 100%
[7/7] Installing nvidia-drm-kmod-550.120...
[7/7] Extracting nvidia-drm-kmod-550.120: 100%
=====
Message from egl-wayland-1.1.13:

--
===>   NOTICE:

The egl-wayland port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
=====
Message from xorg-server-21.1.14,1:

--
Xorg-server has been installed.

If your kernel is compiled with the EVDEV_SUPPORT option enabled
(default starting from FreeBSD 12.1) it is recommended to enable evdev mode in
pointer device drivers like ums(4) and psm(4). This will give improvements like
better tilt wheel support for mice and centralized gesture support via
xf86-input-synaptics or libinput drivers for touchpads.

This is also needed for PS/2 devices to be properly detected by Xorg when
moused service is disabled in /etc/rc.conf and kernel is compiled with
EVDEV_SUPPORT.

To enable evdev in such a device, run the following:

# sysctl kern.evdev.rcpt_mask=6

To make it persistent across reboots, add the following to /etc/sysctl.conf:

kern.evdev.rcpt_mask=6

In case you're using a serial mouse or any other mouse that *only* works over
sysmouse(4) and moused(8) on an evdev enabled kernel, please run this:

# sysctl kern.evdev.rcpt_mask=3

To make it persistent across reboots, add to this /etc/sysctl.conf:

kern.evdev.rcpt_mask=3
=====
Message from drm-61-kmod-6.1.92:

--
The drm-61-kmod port can be enabled for amdgpu (for AMD
GPUs starting with the HD7000 series / Tahiti) or i915kms (for Intel
APUs starting with HD3000 / Sandy Bridge) through kld_list in
/etc/rc.conf. radeonkms for older AMD GPUs can be loaded and there are
some positive reports if EFI boot is NOT enabled.

For amdgpu: kld_list="amdgpu"
For Intel: kld_list="i915kms"
For radeonkms: kld_list="radeonkms"

Please ensure that all users requiring graphics are members of the
"video" group.
=====
Message from nvidia-driver-550.120:

--
To use these drivers, make sure that you have loaded the NVidia kernel
module, by running

	# kldload nvidia-modeset

on the command line, or by putting ``nvidia-modeset'' on the ``kld_list''
variable in /etc/rc.conf, either manually or by running

	# sysrc kld_list+=nvidia-modeset

If you build this port with FreeBSD AGP GART driver, make sure you have
agp.ko kernel module installed and loaded, since nvidia.ko will depend
on it, or have your kernel compiled with "device agp".  Otherwise, the
NVidia kernel module will not load.  Also, please set correct value for
``Option "NvAGP"'' in ``Device'' section of your X11 configuration file.

When building with Linux compatibility support, make sure that linux.ko
module is available as well (or have it compiled in kernel).  It can be
loaded via /boot/loader.conf, or later in the boot process if you add

	linux_enable="YES"

to your /etc/rc.conf.

If X.org cannot start and reports

	(EE) NVIDIA(0): Failed to obtain a shared memory identifier.

in /var/log/Xorg.0.log while actually you have ``options SYSVSHM''
enabled in kernel, the sysctl ``kern.ipc.shmall'' should be increased.

See /usr/local/share/doc/NVIDIA_GLX-1.0/README for more information.
=====
Message from nvidia-drm-61-kmod-550.120_1:

--
Modesetting must be enabled to use nvidia-drm.ko for graphics. This can be done
by setting the modeset sysctl, the equivalent of the modeset kernel parameter
on Linux.

hw.nvidiadrm.modeset=1

This must be set before loading nvdidia-drm.ko, most easily done by placing the
above in /boot/loader.conf.
=====
Message from nvidia-drm-kmod-550.120:

--
Modesetting must be enabled to use nvidia-drm.ko for graphics. This can be done
by setting the modeset sysctl, the equivalent of the modeset kernel parameter
on Linux.

hw.nvidiadrm.modeset=1

This must be set before loading nvdidia-drm.ko, most easily done by placing the
above in /boot/loader.conf.

设置

根据安装提示设置内核模块加载和设置:

设置内核模块加载以及启动参数
# 必须在加载 nvidia-drm.ko 之前设置,所以添加到 /etc/loader.conf
echo "hw.nvidiadrm.modeset=1" >> /boot/loader.conf

# 内核模块加载,并且启用Linux兼容
sysrc kld_list+=nvidia-modeset
sysrc linux_enable="YES"

参考