Differences between revisions 131 and 132
Revision 131 as of 2024-04-29T06:18:15+0000
Size: 12141
Comment: Having to be in the video group to access /dev/dri* is not an issue and works as intended like that.
Revision 132 as of 2024-11-29T07:05:01+0000
Size: 12349
Editor: GrahamPerrin
Comment: Let's not be blasé about encouraging people to publish core.txt.⋯ file content.
Deletions are marked like this. Additions are marked like this.
Line 153: Line 153:
 * If a kernel panic: Contents of `core.$n.txt` (in `/var/crash`)  * If a kernel panic: Contents of `core.$n.txt` (in `/var/crash`) – '''only if''' the text file does '''not''' disclose [[ https://www.reddit.com/r/freebsd/comments/d6hv3l/sensitivity_of_varcrashcoretxt_file_content/lzio8f5/ | a password or other sensitive information ]]

Introduction

Graphics team members help to maintain the low-level components that support desktop environments (DEs) such as KDE Plasma and Gnome.

This level includes:

  • X.Org-related ports – X server, libraries, tools
  • Wayland

  • Mesa ports – libGL, dri, libglesv2, libEGL, freeglut, libGLU, libGLw, mesa-demos, libosmesa
  • OpenCL low-level libraries

  • Userland drivers – xf86-*

  • Input device detection and configuration
  • GPU drivers – drm-* kernel modules.

This level does not include:

  • The desktop environments themselves
  • Image processing or drawing software applications.

Hardware Support

If your use case is not covered by DRM or nvidia-driver, non-DRM – and if your computer uses UEFI – you may use the system console frame buffer (SCFB). See x11-drivers/xf86-video-scfb and GraphicsOld/SCFB.

Features that will not work with the system console frame buffer include:

  • sleep and wake (suspend and resume) of the computer.

DRM

The Direct Rendering Manager is a subsystem of the Linux kernel responsible for interfacing with GPUs of modern video cards.

graphics/drm-kmod indirectly provides a range of kernel modules for use with:

  • AMD graphics hardware
  • Intel Integrated Graphics.

nvidia-drm-kmod indirectly provides a kernel module for use with:

  • NVIDIA graphics hardware.

AMD graphics

Refer to the handbook to get information about how to configure an AMD graphics card.

Intel Integrated Graphics (aka HD Graphics)

Refer to the handbook to get information about how to configure an Intel graphics card.

NVIDIA Proprietary Graphics Driver

Refer to the handbook to get information about how to configure an NVIDIA graphics card with the proprietary driver.

NVIDIA Open Source Graphics Driver

nvidia-drm.ko complements the x11/nvidia-driver port.

FreeBSD Display Driver – x64, 535.104.05, FreeBSD x64, NVIDIA includes:

  • a list of products that are supported by version 535.104.05
  • a download of source code, not to be confused with the ports (below) that benefit from the code.

nvidia-drm-510-kmod

Install graphics/nvidia-drm-kmod. If a package is not yet available, be patient:

  • the port was added 2023-08-20, builds of packages will take some time.

Configure your /etc/rc.conf:

  • # sysrc -f /etc/rc.conf kld_list+=nvidia-drm

Ensure that your UID is a member of the video group.

Restart your system, or run:

  • # service kld restart

nvidia-drm-515-kmod

Install graphics/nvidia-drm-515-kmod, then follow the configuration and other hints above.

General

Other NVIDIA-related areas include:

Virtual machines

VMware

Experimental support for accelerated graphics in FreeBSD as guest OS in VMware was added to graphics/drm-devel-kmod.

Known issue:

  • A race condition in which the machine locks when loading the graphics driver or starting X. Observable only if the guest is configured with more than one CPU.

VirtualBox

A DRM driver for VirtualBox is planned for the Linux source tree. Once there, a FreeBSD port is planned.

Side notes

The tables that were once here were not a comprehensive record of supported hardware:

  • hardware was listed only if it had been explicitly tested/confirmed by developers and/or users
  • graphics hardware missing from the tables may or may not work.

GPU codenames vs. marketing names:

  • entries may be misleading because they use marketing names as the key

  • the table needed to be rewritten using GPU codenames as the key.

If you have tested hardware that is not listed, please report the results.

Known issues

Xorg -configure crashes with a segmentation fault.

  • Do not run this command – X.Org configuration is automated.
  • If a section override is required, place the file for the section in /usr/local/etc/X11/xorg.conf.d/.

Problems with drm-kmod on i386.

  • Disable PAE – add hw.above4g_allow=0 to /boot/loader.conf.

Reporting

Issues/bugs

If encountering problems in either the kernel driver or the in-development ports, post the following information to the mailing list

  • dmesg command output

  • pciconf -lvbce command output

  • devinfo -vr command output

  • sysctl hw.model

  • pkg info command output

  • Contents of xorg.conf file (and included sub-files, if any)

  • Contents of Xorg.log (if the problem is at X.Org startup or during your X session)
  • Any ports build or installation errors (if relevant)
  • If a kernel panic: Contents of core.$n.txt (in /var/crash) – only if the text file does not disclose a password or other sensitive information

  • Any other details that may be relevant

Debugging tips

  • It is useful to see what features the kernel reports as being available, especially in regards to driver features exposed via the linuxkpi. On FreeBSD these are mapped to sysctl compat.linuxkpi. The best way to see what's available for your driver is to execute sysctl compat.linuxkpi after you loaded the driver. For description of what these parameters do, call sysctl with the description flag.
    • % sysctl -d compat.linuxkpi.enable_fbc

      compat.linuxkpi.enable_fbc: Enable frame buffer compression for power savings (default: -1 (use per-chip default))

  • Starting with FreeBSD 13 you can use the direct driver sysctls, the compat.linuxkpi will be removed at one point.
    • % sysctl -d hw.i915kms

  • Periodically you will have a kernel panic but a core will not be recorded. You can test setting this sysctl knob which will prevent you from entering ddb on panic which has been found to unreliable in some circumstances:
    • debug.debugger_on_panic=0

  • Also, adding this to your /boot/loader.conf can help in these scenarios:
    • dev.drm.skip_ddb="1"

  • The following can be useful for providing context and can be set in /boot/loader.conf to ensure debug output remains enabled. The one problem with it is that debug output will slow things down enough to mask many problems.:
    • dev.drm.drm_debug_persist="1"

  • Want to enable all DRM related debug flags at runtime? There is a knob for that:
    • dev.drm.drm_debug=-1

  • kms drivers through linux-kpi report debugging information using debugfs. To mount it:
    • # mkdir /debug && mount -t debugfs none /debug

  • To test how hardware acceleration is working you may want to run glxgears, but by default it may force syncing with your display (60fps for example). To disable this you can invoke glxgears like so:

    • $ env vblank_mode=0 glxgears

Test results

If everything works, let us know on the mailing list. Your information helps us confirm which hardware/software configurations work well.

Please include:

  • dmesg command output

  • pciconf -lvbce command output

  • pkg info command output

  • Contents of xorg.conf file (and included sub-files, if any)

  • Contents of Xorg.log
  • Any other details that may be relevant

If your laptop works well with FreeBSD, add it to the Laptops page.

Development

Developer information, including tasks in progress, is in the legacy GraphicsOld/Developer area.

Team

who

area of responsibility/knowledge

NiclasZeising

Everything ports related, team meetings, etc.

EmmanuelVadot

mesa, drm drivers

BaptisteDaroussin

ports, a bit of everything

WarnerLosh

core liason, contact him before committing maintainer timeouts

JungukKim

ports, member emeritus

KoopMast

ports, member emeritus

MartinWilke

ports, member emeritus

Contact

TODO

Tasks for contributors

Task

Developer

Status

Comment

Get Intel GPU Tools working

Initial port exists

Outdated initial port here

Notes from meetings

https://github.com/freebsd/meetings#readme

Preferred policies on patches

In the past, the FreeBSD graphics stack got far behind the upstream sources. One of the main reasons for this was that as a project we'd been terrible about getting changes accepted upstream (or even trying to upstream them). These technical issues lead to much frustration and exacerbated many teamwork issues with the stack. For a time, things were somewhat dysfunctional. However, the graphics teams has caught up on all this technical debt by upstreaming changes; integrating Linux compatible APIs (like evdev); or by writing adapters to make FreeBSD-specific things like devd look like their Linux counterparts.

To avoid a repeat of this accumulation of technical debt, and all the issues that go with it, the graphics teams has a number of preferred practices it likes to follow. Generally we prefer using released versions of the elements of FreeBSD graphics stack. Issues come up between releases, and if the patches are accepted by upstream, then we'll include them. When there are issues that are being sorted out upstream, we prefer to let that run its course because they are usually the experts, though exceptions are made when reasonable. At the very least, we'd like any patches submitted upstream before they are included in a port to strongly encouraging upstreaming. Finally, when new features are implemented, there's a strong preference for using Linux and other APIs upstream sources are using over inventing something new for FreeBSD where possible.

We also desire to have FreeBSD be in the CI process for as many upstream sources as possible, though currently many do not yet have FreeBSD CI support. Helping upstreams get better CI integration will help us maintain the velocity of releases as FreeBSD is more likely to work and needs less regression testing on updates by us.

Legacy documentation

See GraphicsOld. If migration from the old page omitted anything critical, please notify the team.


CategoryProject CategoryTeam CategoryPorts

Graphics (last edited 2024-11-29T07:05:01+0000 by GrahamPerrin)