Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Make.conf/VIDEO CARDS"

From Funtoo
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Subpages|Mix-ins,DRI vs. Gallium vs. NVIDIA,Understanding What's Available}}
{{warning|From a regular user perspective, this page is deprecated.  We use [[Funtoo_Profiles]] now to set video cards. This page still serves as a useful reference for graphics cards mix-ins and their internals.}}
 
{{Subpages|Mix-ins,DRI vs. Gallium vs. NVIDIA,Understanding What's Available,Daniel's Simple Hybrid Graphics,NVIDIA and Nouveau Driver Switching}}
 
{{Note|If you are simply looking for quick information on how to configure your system, see [[#Changing VIDEO_CARDS Settings|Changing VIDEO_CARDS Settings]] below.}}


The {{c|VIDEO_CARDS}} [[make.conf]] setting is used to define what graphics support is enabled on your system. This graphics support can include a combination of ''kernel drivers'' and ''user-space libraries'' that as a whole provide graphics capability for your system. This Portage variable is generally used only by packages that directly implement graphics support, such as {{c|media-libs/mesa}} and a few others. Typically, {{c|VIDEO_CARDS}} settings are "stacked", which means that multiple related flags are specified, typically enabling various parts of the graphics stack that work together. Here are some useful examples:
The {{c|VIDEO_CARDS}} [[make.conf]] setting is used to define what graphics support is enabled on your system. This graphics support can include a combination of ''kernel drivers'' and ''user-space libraries'' that as a whole provide graphics capability for your system. This Portage variable is generally used only by packages that directly implement graphics support, such as {{c|media-libs/mesa}} and a few others. Typically, {{c|VIDEO_CARDS}} settings are "stacked", which means that multiple related flags are specified, typically enabling various parts of the graphics stack that work together. Here are some useful examples:
Line 41: Line 45:
}}
}}


{{/Mix-Ins}}
{{/Mix-ins}}


Please note that it is possible to combine these mix-ins as well, so if you have hybrid graphics on your laptop and want to be able to use Intel and NVIDIA graphics installed, this will work. Note that additional setup is required to switch between them seamlessly via a simple BIOS change, this will at least get all the necessary bits installed:
Please note that it is possible to combine these mix-ins as well, so if you have hybrid graphics on your laptop and want have Intel and NVIDIA graphics installed and switch between them using the BIOS, this will work. Note that additional setup is required to switch between them seamlessly via a simple BIOS change, this will at least get all the necessary bits installed:


{{console|body=
{{console|body=

Latest revision as of 23:36, February 15, 2021

   Warning

From a regular user perspective, this page is deprecated. We use Funtoo_Profiles now to set video cards. This page still serves as a useful reference for graphics cards mix-ins and their internals.

   Note

If you are simply looking for quick information on how to configure your system, see Changing VIDEO_CARDS Settings below.

The VIDEO_CARDS make.conf setting is used to define what graphics support is enabled on your system. This graphics support can include a combination of kernel drivers and user-space libraries that as a whole provide graphics capability for your system. This Portage variable is generally used only by packages that directly implement graphics support, such as media-libs/mesa and a few others. Typically, VIDEO_CARDS settings are "stacked", which means that multiple related flags are specified, typically enabling various parts of the graphics stack that work together. Here are some useful examples:

   /etc/make.conf (bash source code)
# This setting will support nearly all X/DRI-based Intel integrated graphics:
VIDEO_CARDS="intel dri3 i965 i915"

# This next setting is similar to the one above but will also enable Vulkan support for the DRI driver:
VIDEO_CARDS="intel vulkan-intel dri3 i965 i915"

# This next setting will enable Gallium for Intel integrated graphics -- The Intel drivers are currently more mature:
VIDEO_CARDS="intel gallium-i915"

# This next setting could be useful if you have hybrid graphics on your laptop and you plan to use X:
VIDEO_CARDS="intel dri3 i965 i915 nvidia"

# This setting would be good for X-based graphics with Radeon cards using gallium:
VIDEO_CARDS="amdgpu vulkan-amdgpu radeon gallium-r300 gallium-r600 gallium-radeonsi"

Funtoo Differences

Starting with Funtoo Linux 1.4, VIDEO_CARDS settings work a bit differently than in Gentoo and these differences are documented here. The design philosophy for the use of VIDEO_CARDS is to have each atom in the string map to a single specific graphics driver or capability. So, rather than have USE="gallium" VIDEO_CARDS="nouveau" to enable the nouveau driver with Gallium backend, Funtoo specifies just VIDEO_CARDS="gallium-nouveau". This turns out to be useful in practice since there are DRI and Gallium nouveau and nouveau-gallium drivers that can now be set independently.

The Funtoo VIDEO_CARDS flags are designed to have a consistent format. If just a graphics driver is listed, such as i965, then it is an X-based DRI driver. Drivers that use the new Gallium driver architecture are in the format gallium-<driver> such as gallium-radeonsi. In addition, any optional framework is listed as a prefix, such as vulkan-i965 for optional DRI-based Vulkan support for i965+ Intel cards.

Also note that it is possible to have VIDEO_CARDS set for you via use of a Funtoo profile mix-in.

Changing VIDEO_CARDS Settings

When changing VIDEO_CARDS settings, either directly by modifying /etc/make.conf or by use of a mix-in (recommended -- see below) it is important to perform a deep update of your system and ensure that X is configured correctly for your new settings. At the minimum, this generally involves performing an emerge -auDN @world. You will likely notice a rebuild of media-libs/mesa and perhaps x11-libs/libdrm, and the new installation of one or more X.org drivers.

   Important

It's generally best to use the mix-ins listed below to manage graphics settings, rather than modifying VIDEO_CARDS directly! These five mix-ins will work for 99% of Funtoo Linux users!

The following mix-ins are available for your use, and support can be enabled as follows, assuming you have either x11-base/xorg-server or x11-base/xorg-drivers already installed on your system:

root # ego profile mix-in +gfxcard-intel
root # emerge -auDN @world

Funtoo Graphics Mix-Ins

gfxcard-intel
This mix-in is equivalent to gfxcard-intel-classic or gfxcard-intel-iris, depending on the release you're running. Currently, it defaults to gfxcard-intel-classic on 1.4-release and to gfxcard-intel-classic on Next release. Do not enable more than 1 gfxcard-intel* mix-in at the same time. The result is not what you might expect.
gfxcard-intel-classic
This mix-in enables Intel graphics support based on the older i915 mesa driver (not to be confused with the i915 kernel driver). Choose this if you have a Gen3 or older chipset.
gfxcard-intel-iris
This mix-in enables Intel graphics support for cards with glamor modesetting support (drivers i965 or iris), including support OpenGL ES (>=Gen4) and OpenCL and Vulkan (>=Gen7) and video acceleration where available. If your card is >=Gen5, do an emerge libva-intel-driver or emerge media-libs/libva-intel-media-driver (for >=Gen8) afterwards to ensure you have full video acceleration support.
gfxcard-amdgpu
This mix-in enables support for modern Radeon cards, Southern Islands -- GFX Core 6 (see this x.org reference) and greater. Includes Vulkan and video acceleration where available. Drivers are built for both the Gallium framework (modern replacement for DRI framework) and DRI framework. Glamor is used to accelerate 2D operations.
gfxcard-radeon
This mix-in enables support for modern Radeon cards, R600 through Northern Islands -- GFX Core 4 and 5 (see this x.org reference). Drivers are built for the Gallium framework (modern replacement for DRI framework) as well as DRI framework. Glamor is used to accelerate 2D operations.
gfxcard-older-ati
Use this mix-in to enable support for R300 up to (but not including) R600 Radeon cards -- -- GFX Core 3 (see this x.org reference). DRI as well as Gallium-based drivers are enabled.
gfxcard-ancient-ati
Use this mix-in to enable support pre-R300 cards -- GFX Core 1 and 2 (see this x.org reference). These drivers are DRI-based.
gfxcard-nvidia
Use this to enable support for proprietary NVIDIA drivers. You will also need to emerge nvidia-kernel-modules, blacklist nouveau and add yourself to the video group. See this documentation for more details. Note that Funtoo now has two catpkgs for NVIDIA proprietary graphics -- nvidia-drivers and nvidia-kernel-modules -- to aid the use of NVIDIA acceleration on containers.
gfxcard-nvidia-legacy
Proprietary NVIDIA drivers like above, but the legacy version of the driver that supports older hardware. See https://www.nvidia.com/en-us/drivers/unix/ and browse the specific driver version that emerge is installing to get detailed compatibility information.
gfxcard-nouveau
Use this mix-in to enable support for Open Source nouveau drivers.

Please note that it is possible to combine these mix-ins as well, so if you have hybrid graphics on your laptop and want have Intel and NVIDIA graphics installed and switch between them using the BIOS, this will work. Note that additional setup is required to switch between them seamlessly via a simple BIOS change, this will at least get all the necessary bits installed:

root # ego profile mix-in +gfxcard-intel +gfxcard-nvidia
root # emerge -auDN @world nvidia-kernel-modules
   Note

Reconfiguration of your /etc/X11/xorg.conf, further configuration and/or rebooting may be required after enabling new graphics support.

DRI3

The most well-supported version of DRI is version 2. There is a dri3 VIDEO_CARDS setting that can be enabled to enable support for version 3 of DRI, which should offer improved performance. DRI version 3 support may be less mature than the same driver with just version 2 support, so the availability of a VIDEO_CARDS option allows it to be turned off if you experience video issues. In general, however, dri3 has been around long enough to be generally robust for most users.

NVIDIA Drivers

The proprietary NVIDIA drivers are their own beast and have their own specific documentation on the wiki.

Video Acceleration Architectures

In addition to graphics driver architectures, over the years there have been different architectures designed to help accelerate the playback of video. As you might guess, these architectures are different levels of support depending upon the graphics driver selected. The VIDEO_CARDS settings related to graphics drivers are xa, vaapi, vdpau and xvmc. In Funtoo it is safe, and recommended, to append all these settings to your VIDEO_CARDS setting, which can be done by adding this to the end of your /etc/make.conf:

   /etc/make.conf (bash source code)
VIDEO_CARDS="${VIDEO_CARDS} xa vaapi vdpau xvmc"

If you are using the workstation or desktop flavor, these settings will be enabled for you automatically. In addition, you may want to add some or all of these settings to your USE flags to enable any optional video acceleration support in regular software. These VIDEO_CARDS settings enable the support in the underlying graphics driver itself only, if available.

It's also important to note that while most of the time, video acceleration is provided by the underlying graphics driver, this is not the case for Intel integrated graphics, where it is necessary to emerge another ebuild to enable full video acceleration support:

root # emerge libva-intel-driver

Even more confusing, there is a new libva-intel-media-driver which is a new design of the VAAPI-based acceleration for Intel integrated graphics, and requires a bleeding-edge installation of media-libs/libva. This is something that is not yet actively supported under Funtoo but is something that I hope to play with soon.

Use within Ebuilds

Inside ebuilds, the VIDEO_CARDS settings is USE_EXPANDed to a USE flag with a prefix of video_card_. For example, radeonsi will set the video_card_radeonsi USE flag, gallium-osmesa will set the video_card_gallium-osmesa USE flag, etc. Pay careful attention to the use of underscores and hyphens. Hyphens are used in the video card variable name itself, whereas underscores are used in video_card_ only.

VIDEO_CARDS Settings

The most-common VIDEO_CARDS settings are listed below. For a comprehensive list of settings, type emerge -av mesa and peruse the list of USE flags.

name description platforms
name description platforms
amdgpu AMDGPU is an Open Source graphics driver developed by AMD that supports the latest AMD Radeon graphics cards (GCN 1.2, HD 7xxxx+). It is typically used in conjunction with Mesa's radeonsi driver which provides OpenGL support. There is a kernel-space part and a user-space part (in DRI Gallium X
gallium-i915 This is a gallium-based driver for Intel integrated graphics chipsets, i915 or later. Gallium
gallium-nouveau Open Source NVIDIA Gallium-based graphics driver. Gallium
gallium-osmesa "Osmesa" stands for "off-screen MESA" and allows rendering of graphics into a framebuffer in memory. This supports Gallium-based rendering. Gallium
gallium-r300 A Gallium-based driver for older Radeon cards: R300, R350, RV350, RV380, RS400, RS480, R420, R423, RV410, RS600, RS690, RS740, RV515, R520, RV530, RV560, RV570, R580 Gallium
gallium-r600 A Gallium-based driver for Radeon graphics cards: R600, RV610, RV630, RV620, RV635, RV670, RS780, RS880, RV770, RV730, RV710, RV740, CEDAR, REDWOOD, JUNIPER, CYPRESS, PALM (Wrestler), SUMO, SUMO2, ARUBA, BARTS, TURKS, CAICOS, CAYMAN Gallium
gallium-radeonsi Open Source Radeon driver providing support for modern Radeon graphics (HD5430-HD5970, HDxxx, HD7xxx, R7 cards, R5 230, R9 280 and other R9 cards.) Gallium-based driver. Gallium
gallium-swrast Gallium-based software-only OpenGL driver, also known as "softpipe". This setting will also enable Intel's "swr" driver (taking advantage of some Intel processor instructions for acceleration) on supported CPU architectures. Gallium X
gallium-tegra Open Source NVIDIA driver for Tegra (ARM CPU + Integrated NVIDIA graphics). Gallium-based driver. Gallium
gallium-virgl This driver provides accelerated OpenGL rendering within virtual machines via VirtualGL. Gallium-based driver. Gallium
i915 Enables support for Intel integrated graphics, i915 and more recent chipset. Most modern laptops with Intel integrated graphics will want this enabled. DRI X
i965 Enables support for Intel integrated graphics, i965 and more recent chipset. Most modern laptops with Intel integrated graphics will want this enabled. DRI X
intel Enables general support for Intel integrated graphics. This setting is required when using any Intel-related settings DRI X
nouveau Open Source NVIDIA DRI-based X graphics driver. DRI X
nvidia NVIDIA proprietary accelerated driver support. This driver includes support for traditional X-based accelerated rendering and Vulkan. Although this driver supports X, it does not use the kernel's DRI. Vulkan X
osmesa "Osmesa" stands for "off-screen MESA" and allows rendering of graphics into a framebuffer in memory. This supports X/DRI-based rendering. DRI X
r100 An X/DRI-based driver for older Radeon cards: R100, RV100, RV200, RS100, RS200 DRI X
r200 An X/DRI-based driver for older Radeon cards: R200, RV250, RV280, RS300 DRI X
radeon General support for Radeon cards. This setting is required when using any Radeon-related setting. DRI X
swrast DRI-based driver that does OpenGL without any hardware support. Enabled by default regardless of profile settings, since Mesa needs at least one "real" output to generate libGL. DRI X
virgl This driver provides accelerated OpenGL rendering within virtual machines via VirtualGL. X/DRI-based driver. DRI X
vulkan-amdgpu Enable Vulkan support for AMDGPU. Vulkan
vulkan-intel Enables Mesa's DRI-based Vulkan driver for Intel chipsets. DRI Vulkan