ⓘ Free and open-source graphics device driver
A free and open-source graphics device driver is a software stack which controls computer-graphics hardware and supports graphics-rendering application programming interfaces and is released under a free and open-source software license. Graphics device drivers are written for specific hardware to work within a specific operating system kernel and to support a range of APIs used by applications to access the graphics hardware. They may also control output to the display if the display driver is part of the graphics hardware. Most free and open-source graphics device drivers are developed by the Mesa project. The driver is made up of a compiler, a rendering API, and software which manages access to the graphics hardware.
Drivers without freely and legally -available source code are commonly known as binary drivers. Binary drivers used in the context of operating systems that are prone to ongoing development and change such as Linux create problems for end users and package maintainers. These problems, which affect system stability, security and performance, are the main reason for the independent development of free and open-source drivers. When no technical documentation is available, an understanding of the underlying hardware is often gained by clean-room reverse engineering. Based on this understanding, device drivers may be written and legally published under any software license.
In rare cases, a manufacturers driver source code is available on the Internet without a free license. This means that the code can be studied and altered for personal use, but the altered and usually the original source code cannot be freely distributed. Solutions to bugs in the driver cannot be easily shared in the form of modified versions of the driver. Therefore, the utility of such drivers is significantly reduced comparison to free and open-source drivers.
1.1. Problems with binary drivers Software developers view
There are objections to binary-only drivers based on copyright, security, reliability and development concerns. As part of a wider campaign against binary blobs, OpenBSD lead developer Theo de Raadt said that with a binary driver there is "no way to fix it when it breaks and it will break"; when a product which relies on binary drivers is declared to be end-of-life by the manufacturer, it is effectively "broken forever." The project has also stated that binary drivers "hide bugs and workarounds for bugs", an observation which has been somewhat vindicated by flaws found in binary drivers including an exploitable bug in Nvidias 3D drivers discovered in October 2006 by Rapid7. It is speculated that the bug has existed since 2004; Nvidia have denied this, asserting that the issue was only communicated to them in July 2006 and the 2004 bug was a bug in X.Org not in Nvidias driver.
Binary drivers often do not work with current versions of open-source software, and almost never support development snapshots of open-source software; it is usually not directly possible for a developer to use Nvidias or ATIs proprietary drivers with a development snapshot of an X server or a development snapshot of the Linux kernel. Features like kernel mode-setting cannot be added to binary drivers by anyone but the vendors, which prevents their inclusion if the vendor lacks capacity or interest.
In the Linux kernel development community, Linus Torvalds has made strong statements on the issue of binary-only modules: "I refuse to even consider tying my hands over some binary-only module. I want people to know that when they use binary-only modules, its their problem". Another kernel developer, Greg Kroah-Hartman, has said that a binary-only kernel module does not comply with the kernels license the GNU General Public License; it "just violates the GPL due to fun things like derivative works and linking and other stuff." Writer and computer scientist Peter Gutmann has expressed concern that the digital rights management scheme in Microsofts Windows Vista operating system may limit the availability of the documentation required to write open drivers, since it "requires that the operational details of the device be kept confidential."
In the case of binary drivers, there are objections due to free software philosophy, software quality and security concerns. In 2006 Greg Kroah-Hartman concluded that:
"Closed source Linux kernel modules are illegal. Thats it, it is very simple. Ive had the misfortune of talking to a lot of different IP lawyers over the years about this topic, and every one that Ive talked to all agree that there is no way that anyone can create a Linux kernel module, today, that can be closed source. It just violates the GPL due to fun things like derivative works and linking."
The Linux kernel has never maintained a stable in-kernel application binary interface. There are also concerns that proprietary drivers may contain backdoors, like the one found in Samsung Galaxy-series modem drivers.
1.2. Problems with binary drivers Hardware developers view
When applications such as a 3D game engine or a 3D computer graphics software shunt calculations from the CPU to the GPU, they usually use a special-purpose API like OpenGL or Direct3D and do not address the hardware directly. Because all translation from API calls to GPU opcodes is done by the device driver, it contains specialized knowledge and is an object of optimization. Due to the history of the rigidity of proprietary driver development there has been a recent surge in the number of community-backed device drivers for desktop and mobile GPUs. Free and Open Hardware organizations like FOSSi, LowRISC, and others, would also benefit from the development of an open graphical hardware standard. This would then provide computer manufacturers, hobbyists, and the like with a complete, royalty-free platform with which to develop computing hardware and related devices.
The desktop computer market was long dominated by PC hardware using the x86/x86-64 instruction set and GPUs available for the PC. With three major competitors Nvidia, AMD and Intel. The main competing factor was the price of hardware and raw performance in 3D computer games, which is greatly affected by the efficient translation of API calls into GPU opcodes. The display driver and the video decoder are inherent parts of the graphics card: hardware designed to assist in the calculations necessary for the decoding of video streams. As the market for PC hardware has dwindled, it seems unlikely that new competitors will enter this market and it is unclear how much more knowledge one company could gain by seeing the source code of other companies drivers.
The mobile sector presents a different situation. The functional blocks the application-specific integrated circuit display driver, 2- and 3D acceleration and video decoding and encoding are separate semiconductor intellectual property SIP blocks on the chip, since hardware devices vary substantially; some portable media players require a display driver that accelerates video decoding, but do not require 3D acceleration. The development goal is not only raw 3D performance, but system integration, power consumption and 2D capabilities. There is also an approach which abandons the traditional method Vsync of updating the display and makes better use of sample and hold technology to lower power consumption.
During the second quarter of 2013 79.3 percent of smartphones sold worldwide were running a version of Android, and the Linux kernel dominates smartphones. Hardware developers have an incentive to deliver Linux drivers for their hardware but, due to competition, no incentive to make these drivers free and open-source. Additional problems are the Android-specific augmentations to the Linux kernel which have not been accepted in mainline, such as the Atomic Display Framework ADF. ADF is a feature of 3.10 AOSP kernels which provides a dma-buf-centric framework between Androids hwcomposer HAL and the kernel driver. ADF significantly overlaps with the DRM-KMS framework. ADF has not been accepted into mainline, but a different set of solutions addressing the same problems known as atomic mode setting is under development. Projects such as libhybris harness Android device drivers to run on Linux platforms other than Android.
2. Performance comparisons
Phoronix, which compares free drivers, is a source for real-world testing:
- A February 2017 comparison indicated that Mesa 17.1dev was equal to or better than the AMD GPU driver 16.60 in OpenGL and 20-30 percent lower in Vulkan.
- A June 2017 Comparison Windows 10 Radeon Software vs. Ubuntu 17.04 + Linux 4.12 + Mesa 17.2-dev -> Result mesa radeonsi at same level
- A 29 April 2013 comparison of FOSS and proprietary drivers
- 2019-01: Comparison Mesa 18.2, 18.3, 19.0dev RadeonSI/RADV with AMD RX Cards
- 2019-05: Comparison Mesa 19.2 AMD Polaris, Vega to Nvidia
- 2019-01: Comparison Linux 5.0 + Mesa 19.0dev + AMD RX Cards and NVIDIA GeForce Driver 415 with Nvidia Cards
- A 27 January 2014 comparison of proprietary drivers on Linux
- 2018-06: Comparison Mesa 18.2 versus Nvidia Driver 396 with Nvidia GeForce Cards 680 and higher
- 31 March 2013
- A 25 January 2014 comparison of FOSS drivers on Linux
- 2018-07: Comparison Mesa RadeonSI 18.0, 18.1, 18.2 and RadV with Radeon RX Cards
- A January 2017 comparison indicated a difference in power between the Mesa Nouveau and NVidia driver and Kepler and Maxwell. Reclocking is needed for Maxwell in Nouveau to increase level to Kepler. A gap to Mesa exists by 30 to 50% in basic efficiency of driver against Nvidia in all chips.
- 2019-12: Comparison Mesa 18.2.8 to 20.0dev for RadeonSI with Radeon RX 580 and RX Vega 64
- 2018-02: Comparison Mesa 12 to 18 with AMD R580 and R9 Fury for OpenGL and Vulkan Tests
- A 19 March 2014 comparison of Ubuntu with the Free and open-source graphics device driver distributed as part of Mesa 3D, which outperforms Mac OS X 10.9.2 when playing OpenGL-based Xonotic on a 2013 MacBook Air.
- A 27 October 2013 comparison of proprietary drivers on Windows 8.1 and Linux
- 2018-10: Comparison AMD Closed Driver 18.40, AMDVLK and Mesa RadeonSI 18.2, 18.3
- A March 2017 comparison indicated improvements in Mesa for RadeonSI between versions 11.1 and 17.1.
- 19 March 2011
- 2018-11: Comparison 25 AMD and Nvidia Cards with Mesa 19.0dev and NVIDIA Driver 415
- A October 2017 Comparison RadeonSI/RADV Mesa 17.3 + AMDGPU DC vs. the proprietary NVIDIA 387.12 Linux Gaming Performance -> Result: Nvidia clear in lead
It is uncommon for video-game magazines to report benchmark testing on Linux. Benchmarks on Phoronix are limited in scope, primarily testing games which are available on Linux and support automated benchmarking.
3. Software architecture
Free and open-source drivers are primarily developed on and for Linux by Linux kernel developers, third-party programming enthusiasts and employees of companies such as Advanced Micro Devices. Each driver has five parts:
- A libDRM user-space component a wrapper library for DRM system calls, which should only be used by Mesa 3D
- A Linux kernel component KMS driver the display controller driver
- A Linux kernel component DRM
- A Mesa 3D user-space component. This component is hardware-specific; it is executed on the CPU and translates OpenGL commands, for example, into machine code for the GPU. Because the device driver is split, marshalling is possible. Mesa 3D is the only free and open-source implementation of OpenGL, OpenGL ES, OpenVG, GLX, EGL and OpenCL. In July 2014, most of the components conformed to Gallium3D specifications. A fully functional State Tracker for Direct3D version 9 is written in C, and an unmaintained tracker for Direct3D versions 10 and 11 is written in C++. Wine has Direct3D version 9. Another Wine component translates Direct3D calls into OpenGL calls, working with OpenGL.
- Device Dependent X DDX, another 2D graphics device driver for X.Org Server
The DRM is kernel-specific. A VESA driver is generally available for any operating system. The VESA driver supports most graphics cards without acceleration and at display resolutions limited to a set programmed in the video BIOS by the manufacturer.
3.1. Software architecture History
The Linux graphics stack has evolved, detoured by the X Window System core protocol.
4.1. Free and open-source drivers Radeon
AMDs proprietary driver, AMD Catalyst for their Radeon, is available for Microsoft Windows and Linux formerly fglrx. A current version can be downloaded from AMDs site, and some Linux distributions contain it in their repositories. It is in the process of being replaced with an AMDGPU-PRO hybrid driver combining the open-source kernel, X and Mesa multimedia drivers with closed-source OpenGL, OpenCL and Vulkan drivers derived from Catalyst.
The FOSS drivers for ATI-AMD GPUs are being developed under the name Radeon xf86-video-ati or xserver-xorg-video-radeon. They still must load proprietary microcode into the GPU to enable hardware acceleration.
Radeon 3D code is split into six drivers, according to GPU technology: the radeon, r200 and r300 classic drivers and r300g, r600g and radeonsi Gallium3D drivers:
- R300g supports pre-unified shader model microarchitectures: R300, R400 and R500.
- R200 supports the R200 series.
- R600g supports all TeraScale VLIW5/4-based GPUs: R600, R700, HD 5000 Evergreen and HD 6000 Northern Islands.
- Radeonsi supports all Graphics Core Next-based GPUs: HD 7000, HD 8000 and Rx 200 Southern Islands, Sea Islands and Vulcanic Islands.
- Radeon supports the R100 series.
An up-to-date feature matrix is available, and there is support for Video Coding Engine and Unified Video Decoder. The free and open-source Radeon graphics device drivers are not reverse-engineered, but are based on documentation released by AMD without the requirement to sign a non-disclosure agreement NDA. Documentation began to be gradually released in 2007. This is in contrast to AMDs main competitor in the graphics field, Nvidia, which has a proprietary driver similar to AMD Catalyst but provides no support to free-graphics initiatives.
In addition to providing the necessary documentation, AMD employees contribute code to support their hardware and features. At the 2014 Game Developers Conference, The company announced that they were exploring a strategy change to re-base the user-space part of Catalyst on a free and open-source DRM kernel module instead of their proprietary kernel blob.
All components of the Radeon graphics device driver are developed by core contributors and interested parties worldwide. In 2011, the r300g outperformed Catalyst in some cases.
4.2. Free and open-source drivers AMDGPU
The release of the AMDGPU stack was announced on the dri-devel mailing list in April 2015. Although AMDGPU only officially supports GCN 1.2 and later graphics cards, experimental support for GCN 1.0 and 1.1 graphics cards which are only officially supported by the Radeon driver may be enabled via a kernel parameter. A separate libdrm, libdrm-amdgpu, has been included since libdrm 2.4.63.
4.3. Free and open-source drivers Nvidia
Nvidias proprietary driver, Nvidia GeForce driver for GeForce, is available for Windows XP x86-x86-64 and later, Linux x86-x86-64-ARMv7-A, OS X 10.5 and later, Solaris x86-x86-64 and FreeBSD x86/x86-64. A current version can be downloaded from the Internet, and some Linux distributions contain it in their repositories. The 4 October 2013 beta Nvidia GeForce driver 331.13 supports the EGL interface, enabling support for Wayland in conjunction with this driver.
Nvidias free and open-source driver is named nv. It is limited supporting only 2D acceleration, and Matthew Garrett, Dirk Hohndel and others have called its source code confusing. Nvidia decided to deprecate nv, not adding support for Fermi or later GPUs and DisplayPort, in March 2010.
In December 2009, Nvidia announced they would not support free graphics initiatives. On 23 September 2013 The company announced that they would release some documentation of their GPUs.
Nouveau is based almost entirely on information gained through reverse engineering. This project aims to produce 3D acceleration for X.Org/Wayland using Gallium3D. On March 26, 2012, Nouveaus DRM component was marked stable and promoted from the staging area of the Linux kernel. Nouveau supports Tesla- and earlier, Fermi-, Kepler- and Maxwell-based GPUs. On 31 January 2014, Nvidia employee Alexandre Courbot committed an extensive patch set which adds initial support for the GK20A Tegra K1 to Nouveau. In June 2014, Codethink reportedly ran a Wayland-based Weston compositor with Linux kernel 3.15, using EGL and a "100% open-source graphics driver stack" on a Tegra K1. A feature matrix is available. In July 2014, Nouveau was unable to outperform the Nvidia GeForce driver due to missing re-clocking support. Tegra-re is a project which is working to reverse-engineer nVidias VLIW-based Tegra series of GPUs that predate Tegra K1.
Nvidia distributes proprietary device drivers for Tegra through OEMs and as part of its Linux for Tegra formerly L4T development kit. Nvidia and a partner, Avionic Design, were working on submitting Grate free and open-source drivers for Tegra upstream of the mainline Linux kernel in April 2012. The companys co-founder and CEO laid out the Tegra processor roadmap with Ubuntu Unity at the 2013 GPU Technology Conference.
Nvidias Unified Memory driver nvidia-uvm.ko, which implements memory management for Pascal and Volta GPUs on Linux, is MIT licensed. The source code is available in the Nvidia Linux driver downloads on systems that support nvidia-uvm.ko.
4.4. Free and open-source drivers Matrox
Matrox develops and manufactures the Matrox Mystique, Parhelia, G200, G400 and G550. Although the company provides free and open-source drivers for their chipsets which are older than the G550; chipsets newer than the G550 are supported by a closed-source driver.
4.5. Free and open-source drivers S3 Graphics
S3 Graphics develops the S3 Trio, ViRGE, Savage and Chrome, supported by OpenChrome.
4.6. Free and open-source drivers Arm Holdings
Arm Holdings is a fabless semiconductor company which licenses semiconductor intellectual property cores. Although they are known for the licensing the ARM instruction set and CPUs based on it, they also develop and license the Mali series of GPUs. On January 21, 2012, Phoronix reported that Luc Verhaegen was driving a reverse-engineering attempt aimed at the Arm Holdings Mali series of GPUs specifically, the Mali-200 and Mali-400 versions. The reverse-engineering project, known as Lima, was presented at FOSDEM on February 4, 2012. On February 2, 2013, Verhaegen demonstrated Quake III Arena in timedemo mode, running on top of the Lima driver. In May 2018, a Lima developer posted the driver for inclusion in the Linux kernel. As of May 2019, the Lima driver is part of the mainline Linux kernel.
Panfrost is a reverse-engineered driver effort for Mali Txxx Midgard and Gxx Bifrost GPUs. Introducing Panfrost talk was presented at X.Org Developers Conference 2018. As of May 2019, the Panfrost driver is part of the mainline Linux kernel.
ARM has indicated no intention of providing support for their graphics acceleration hardware licensed under a free and open-source license. However, ARM employees sent patches for the Linux kernel to support their ARM HDLCD display controller and Mali DP500, DP550 and DP650 SIP blocks in December 2015 and April 2016.
4.7. Free and open-source drivers Imagination Technologies
Imagination Technologies is a fabless semiconductor company which develops and licenses semiconductor intellectual property cores, among which are the PowerVR GPUs. Intel has manufactured a number of PowerVR-based GPUs. PowerVR GPUs are widely used in mobile SoCs. The company does not provide a FOSS driver or public documentation for the PowerVR. Due to its wide use in embedded devices, the Free Software Foundation has put reverse-engineering of the PowerVR driver on its high-priority project list.
4.8. Free and open-source drivers Vivante
Vivante Corporation is a fabless semiconductor company which licenses semiconductor intellectual property cores and develops the GCxxxx series of GPUs. A Vivante proprietary, closed-source Linux driver consists of kernel- and user-space parts. Although the kernel component is open-source GPL, the user-space components - consisting of the GLES2 implementations and a HAL library - are not; these contain the bulk of the driver logic.
Wladimir J. van der Laan found and documented the state bits, command stream and shader ISA by studying how the blobs work, examining and manipulating command-stream dumps. The Etnaviv Gallium3D driver is being written based on this documentation. Van der Laans work was inspired by the Lima driver, and the project has produced a functional-but-unoptimized Gallium3D LLVM driver. The Etnaviv driver has performed better than Vivantes proprietary code in some benchmarks, and it supports Vivantes GC400, GC800, GC1000, GC2000, GC3000 and GC7000 series. In January 2017, Etnaviv was added to Mesa with both OpenGL ES 2.0 and Desktop OpenGL 2.1 support.
4.9. Free and open-source drivers Qualcomm
Qualcomm develops the Adreno formerly ATI Imageon mobile GPU series, and includes it as part of their Snapdragon mobile SoC series. Phoronix and Slashdot reported in 2012 that Rob Clark, inspired by the Lima driver, was working on reverse-engineering drivers for the Adreno GPU series. In a referenced blog post, Clark wrote that he was doing the project in his spare time and that the Qualcomm platform was his only viable target for working on open 3D graphics. His employers Texas Instruments and Linaro were affiliated with the Imagination PowerVR and ARM Mali cores, which would have been his primary targets; he had working command streams for 2D support, and 3D commands seemed to have the same characteristics. The driver code was published on Gitorious "freedreno", and has been moved to Mesa. In 2012, a working shader assembler was completed; demonstration versions were developed for texture mapping and phong shading, using the reverse-engineered shader compiler. Clark demonstrated Freedreno running desktop compositing, the XBMC media player and Quake III Arena at FOSDEM on February 2, 2013.
In August 2013, the kernel component of freedreno MSM driver was accepted into mainline and is available in Linux kernel 3.12 and later. The DDX driver gained support for server-managed file descriptors requiring X.Org Server version 1.16 and above in July 2014. In January 2016, the Mesa Gallium3D-style driver gained support for Adreno 430; in November of that year, the driver added support for the Adreno 500 series. Freedreno can be used on devices such as 96Boards Dragonboard 410c and Nexus 7 2013 in traditional Linux distributions like Debian and Fedora and on Android.
4.10. Free and open-source drivers Broadcom
Broadcom develops and designs the VideoCore GPU series as part of their SoCs. Since it is used by the Raspberry Pi, there has been considerable interest in a FOSS driver for VideoCore. The Raspberry Pi Foundation, in co-operation with Broadcom, announced on October 24, 2012 that they open-sourced "all the ARM CPU code that drives the GPU". However, the announcement was misleading; according to the author of the reverse-engineered Lima driver, the newly open-sourced components only allowed message-passing between the ARM CPU and VideoCore but offered little insight into Videocore and little additional programability. The Videocore GPU runs an RTOS which handles the processing; video acceleration is done with RTOS firmware coded for its proprietary GPU, and the firmware was not open-sourced on that date. Since there was neither a toolchain targeting the proprietary GPU nor a documented instruction set, no advantage could be taken if the firmware source code became available. The Videocoreiv project attempted to document the VideoCore GPUs.
On February 28, 2014 the Raspberry Pis second anniversary, Broadcom and the Raspberry Pi Foundation announced the release of full documentation for the VideoCore IV graphics core and a complete source release of the graphics stack under a 3-clause BSD license. The free-license 3D graphics code was committed to Mesa on 29 August 2014, and first appeared on Mesas 10.3 release.
4.11. Free and open-source drivers Other vendors
Although Silicon Integrated Systems and VIA Technologies have expressed limited interest in open-source drivers, both have released source code which has been integrated into X.Org by FOSS developers. In July 2008, VIA opened documentation of their products to improve its image in the Linux and open-source communities. The company has failed to work with the open-source community to provide documentation and a working DRM driver, leaving expectations of Linux support unfulfilled. On January 6, 2011, it was announced that VIA was no longer interested in supporting free graphics initiatives.
DisplayLink announced an open-source project, Libdlo, with the goal of bringing support for their USB graphics technology to Linux and other platforms. Its code is available under the LGPL license, but it has not been integrated into an X.Org driver. DisplayLink graphics support is available through the kernel udlfb driver with fbdev in mainline and udl/drm driver, which in March 2012 was only available in the drm-next tree.
Non-hardware-related vendors may also assist free graphics initiatives. Red Hat has two full-time employees David Airlie and Jerome Glisse working on Radeon software, and the Fedora Project sponsors a Fedora Graphics Test Week event before the launch of their new Linux distribution versions to test free graphics drivers. Other companies which have provided development or support include Novell and VMware.
5. Open hardware projects
Project VGA aims to create a low-budget, open-source VGA-compatible video card. The Open Graphics Project aims to create an open-hardware GPU. The Open Graphics Device v1 has dual DVI-I outputs and a 100-pin IDC connector. In September 2010, the first 25 OGD1 boards were made available for grant application and purchase. The Milkymist system on a chip, targeted at embedded graphics instead of desktop computers, supports a VGA output, a limited vertex shader and a 2D texturing unit.
The Nyuzi, an experimental GPGPU processor, includes a synthesizable hardware design written in System Verilog, an instruction set emulator, an LLVM-based C-C++ compiler, software libraries and tests and explores parallel software and hardware. It can run on a Terasic DE2-115 field-programmable gate array board.
If a project uses FPGAs, it generally has a partially or completely closed-source toolchain. There are currently a couple of open-source toolchains available, however, for Lattice-based FPGAs notably for iCE40 and ECP5 boards which utilize Project IceStorm, and Trellis, respectively. There is also a larger, ongoing effort to create the "GCC of FPGAs" called SymbiFlow which includes the aforementioned FPGA toolchains as well as an early-stage open-source toolchain for Xilinx-based FPGAs.