amshafer / nvidia-driver

Fork of the Nvidia FreeBSD driver to port the nvidia-drm.ko module from Linux
44 stars 5 forks source link

FreeBSD Nvidia DRM driver

This is a port of Linux's nvidia-drm.ko that interfaces with the DRM subsystem. FreeBSD has a Linux kernel compatibility layer which nvidia-drm can be modified to run on. This repository packages the base FreeBSD driver files with the Linux driver's nvidia-drm source files (with FreeBSD patches applied). The resulting driver can be found in the nvidia subdirectory.

The most important use case of this is Wayland compositors. Namely, a sway desktop is fully usable on Nvidia hardware when running with this driver. Wayland compositors primarily use the DRM-KMS api for advanced display features and for importing GPU buffers from clients without performing a copy.

Please note that this is currently in the testing stage. While the changes are very stable and can be used to comfortably run a Wayland desktop, more testing is needed before this starts to make its way into the ports tree. Please help by giving it a go and reporting any issues you may find!

Branch Structure

All infrastructure and patches are contained in the baseline branch. This has a driver source code applied on top of it, which the patches are then applied to. Branch names are always the version number of the driver they contain. i.e. if you want a 525.XX.X driver check out the 525.XX.X branch.

Please note that 525 is the first driver series with full nvidia-drm support, drivers that predate this lack the closed-source Nvidia changes necessary.

Dependencies

There are two main things that this driver is dependent on: the FreeBSD src tree and the drm-kmod port. The normal FreeBSD nvidia driver is dependent on the source tree, but drm-kmod is new.

To make this easier there are two variables you can override to set the reference locations:

You can then override them with something like DRMKMODDIR=/home/ashafer/git/drm-kmod/ make.

Ensure that both of these are populated with their corresponding projects via the following:

git clone https://github.com/freebsd/freebsd-src/ 
# see below for details on which branch to use
git clone https://github.com/freebsd/drm-kmod --branch <branch_name>

In the case of drm-kmod you may wish to specify a branch. The branch chosen must match what supports your FreeBSD version and your installation of drm-kmod (if you installed it through pkg).

Ex:

Installing

$ cd nvidia
$ make && make install
$ kldload nvidia-drm

Reporting issues

Please report issues with thorough descriptions of how to reproduce the problem, preferably accompanied by a coredump summary or stack trace when appropriate. This makes things significantly easier to debug.

Known Issues

Individual bugs can be reported in the Github issues tab, but the following are known issues that are currently not supported:

Other Relevant Links

How to update this port

Updating information can be found in UPDATING.md