Disable hardware acceleration linux

How to disable Hardware Acceleration in Linux

How can I turn off Hardware Acceleration in Linux, also known as Direct Rendering. I wish to turn this off, as it messes with some applications like OBS Studio which can’t handle capturing of hardware acceleration on other applications since it’s enabled for the entire system. Certain apps can turn it on and off, but can’t do this for desktop and other apps.

When adding a source to capture from in OBS it just shows a blank capture image, for example if I wanted to record my desktop, it’ll just show it as a blank capture input. Doesn’t work if I want to capture web browser like Google Chrome, unless it’s a single window with no tabs, and hardware acceleration is turned off in it’s settings.

Graphics: Card-1: Intel 3rd Gen Core processor Graphics Controller bus-ID: 00:02.0 Card-2: NVIDIA GF108M [GeForce GT 630M] bus-ID: 01:00.0 Display Server: X.Org 1.15.1 driver: nvidia Resolution: 1366x768@60.0hz GLX Renderer: GeForce GT 630M/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 384.90 Direct Rendering: Yes 

Best Answer

You can configure Xorg to disable OpenGL / GLX.

For a first try, you can run a second X session: switch to tty2, log in and type:

startx -- :2 vt2 -extension GLX 

To permanently disable hardware acceleration, create a file:

/etc/X11/xorg.conf.d/disable-gpu.conf 
Section "Extensions" Option "GLX" "Disable" EndSection 

Note that Xwayland in Wayland compositors like Gnome3-Wayland will ignore settings in xorg.conf.d .

How to verify if hardware acceleration is enabled

If you don’t already have it, install glxinfo ; in APT it’s part of mesa-utils :

Run glxinfo and look for a line about direct rendering (another term for hardware acceleration):

> glxinfo | grep "direct rendering" direct rendering: Yes 

If it says «Yes», hardware acceleration is enabled

Hardware OpenGL rendering in MATLAB

For me the followed works (under ArchLinux with R2017a (prerelease) with a laptop having only intel graphics):

export LD_PRELOAD=/usr/lib/libstdc++.so export LD_LIBRARY_PATH=/usr/lib/xorg/modules/dri/ /net/sw/MATLAB/R2017a/bin/glnxa64/MATLAB 

Note that in the last step I’m calling the MATLAB executable directly (not the helper script that performs some LD_* manipulation)

>> opengl info Version: '3.0 Mesa 17.0.0' Vendor: 'Intel Open Source Technology Center' Renderer: 'Mesa DRI Intel(R) Haswell Mobile ' MaxTextureSize: 16384 Visual: 'Visual 0xcb, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antialias 8 samples)' Software: 'false' HardwareSupportLevel: 'full' SupportsGraphicsSmoothing: 1 SupportsDepthPeelTransparency: 1 SupportsAlignVertexCenters: 1 Extensions: MaxFrameBufferSize: 16384 

Источник

Читайте также:  Run command at linux startup

How to disable Hardware Acceleration in Linux?

How can I turn off Hardware Acceleration in Linux, also known as Direct Rendering. I wish to turn this off, as it messes with some applications like OBS Studio which can’t handle capturing of hardware acceleration on other applications since it’s enabled for the entire system. Certain apps can turn it on and off, but can’t do this for desktop and other apps. When adding a source to capture from in OBS it just shows a blank capture image, for example if I wanted to record my desktop, it’ll just show it as a blank capture input. Doesn’t work if I want to capture web browser like Google Chrome, unless it’s a single window with no tabs, and hardware acceleration is turned off in it’s settings.

Graphics: Card-1: Intel 3rd Gen Core processor Graphics Controller bus-ID: 00:02.0 Card-2: NVIDIA GF108M [GeForce GT 630M] bus-ID: 01:00.0 Display Server: X.Org 1.15.1 driver: nvidia Resolution: 1366x768@60.0hz GLX Renderer: GeForce GT 630M/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 384.90 Direct Rendering: Yes 

Try asking about a specific scenario, not something general like this. Like broadcasting a chrome window through X and OBS on some distribution with some video card and some module. Also refer to where you’ve set which setting off exactly. This helps people understand your setup.

@Zip Maybe you didn’t read the question before properly and understand it. Check and try again, I have asked about a specific scenario, and that is to disable Hardware Acceleration for the whole system not just parts of it just for few applications.

Well, I did not explain myself appropriately. Applications will individually access hardware resources directly through the modules or through libs generally. I don’t think there is a system wide simple switch for that. Anyway you don’t mention your distro nor which drivers you’re using, which may influence the answer. You seem to have issues with a very particular obs setup that may have an easier solution than what you asked, with the bonus that you may keep acceleration on for other stuff. Just ignore this from me if you disagree though, to keep comments clean.

Источник

Firefox Hardware acceleration on Fedora

Firefox on Fedora supports hardware acceleration on Linux so let’s look how to configure it and diagnose potential issues. This guide is adjusted for Fedora only and may not work for stock Mozilla binaries or other distros.

Web page rendering

Accelerated web page rendering is supported on both X11 and Wayland backends via WebRender.

Please note that Firefox requires a GPU with support for OpenGL 3.2 or newer or GLES 3.0 or newer to enable hardware acceleration (Source and further info). You can check your hardware using glxinfo | grep «profile version» for OpenGL and eglinfo | grep version for GLES.

Читайте также:  Контроль устройств astra linux

You can check hardware acceleration state at about:support page, look at Compositing row. If there’s WebRender, you’re running on hardware. If there’s WebRender (software) you’re on non-accelerated backend.

Web page rendering on Wayland

Hardware acceleration should work out-of-the-box on Wayland. If not please file a bug for it.

Web page rendering on X11

X11 backend can tun in two modes — EGL and XGL. You should be on EGL unless you’re running on unsupported config (old NVIDIA drivers, NVIDIA drivers on XWayland or so).

Force disable hardware acceleration

For testing purposes you can disable hardware WebRender. Go to about:config page, set gfx.webrender.software to true and restart browser. There should be WebRender (software) at about:support page then.

Video decoding

Hardware accelerated video decoding (for video playback or for WebRTC) is available via VA-API for both X11 and Wayland. Since firefox-101.0.1-4 package it’s enabled by default for Intel/AMD users.

You can check VA-API acceleration state at about:support page, look at HARDWARE_VIDEO_DECODING row. If there’s available by default, you’re running on hardware by default.

You can disable it at about:config page setting media.hardware-video-decoding.enabled to false.

You may install enhanced-h264ify Firefox extension to disable non-accelerated video formats.

Configure VA-API Video decoding on AMD

Accelerated video decoding works well on AMD as free drivers are available. Free video formats (e.g. VP8/VP9/AV1) should be accelerated out of the box. You can add support for H.264 VA-API decode by these steps:

  • F36 and older: Install ffmpeg from RPM Fusion repository. It’s needed for H.264 decoding.
  • On Fedora 37 and newer, install libavcodec-freeworld and mesa-va-drivers-freeworld. See RPM Fusion howto (section Hardware codecs with AMD (mesa)) for instructions. It’s needed for VA-API H.264 decoding.
  • Run vainfo on terminal to verify that VA-API works.
  • Restart browser.

Configure VA-API Video decoding on Intel

Accelerated video decoding works well on most Intel GPUs as free drivers are available. There are two [1] drivers for Intel cards, libva-intel-driver (provides i965_drv_video.so) and intel-media-driver (iHD_drv_video.so, a.k.a. «iHD», for recent [2] chipsets). Currently, Firefox works with either libva-intel-driver or intel-media-driver.

To determine which codecs your hardware supports, refer to:

You can enable VA-API on Intel with these steps:

  • F36 and older: Install ffmpeg from RPM Fusion repository for H.264 decoding.
  • Fedora 37 and newer: After installing ffmpeg-free, install libavcodec-freeworld from RPM Fusion repository for H.264 decoding.
  • Install libva-intel-driver or intel-media-driver package (depending on your chipset) to enable VA-API on Intel.
  • In a terminal, run vainfo to verify that VA-API works. If VA-API is disabled you’re probably running on new hardware and you need intel-media-driver from RPM Fusion repository non-free. When running the newer driver, you may need to specify the «iHD» driver when running the vainfo command, like so: LIBVA_DRIVER_NAME=iHD vainfo
  • Restart browser.
Читайте также:  Mount error 112 host is down astra linux

Configure VA-API Video decoding on NVIDIA

Accelerated video decoding works on NVIDIA proprietary drivers thanks to Stephen «elFarto» and his nvidia-vaapi-driver project. It’s VA-API implemention using NVIDIA’s NVDEC decoder.

You can enable VA-API on NVIDIA / Fedora 37 by these steps:

  • Install NVIDIA proprietary drivers. Don’t forget to install cuda/nvdec/nvenc support.
  • After installing ffmpeg-free, install libavcodec-freeworld from RPM Fusion repository for H.264 decoding.
  • Install nvidia-vaapi-driver from RPM Fusion repository non-free. Don’t use Fedora provided libva-vdpau-driver package as it’s old and broken.
  • Run Firefox and force enable VA-API as it’s disabled on NVIDIA by default. Go to about:config page and set media.ffmpeg.vaapi.enabled to true.
  • Run Firefox with NVD_BACKEND=direct MOZ_DISABLE_RDD_SANDBOX=1 env variables.

Troubleshooting

  • Verify you’re running on HW accelerated backend (WebRender) under Wayland or X11/EGL at about:support.
  • Run vainfo on terminal to verify that VA-API works.
  • Run Firefox on terminal with MOZ_LOG=»PlatformDecoderModule:5″ env variable. It produces a playback and decode log with VA-API / ffmpeg details.
  • VA-API is also used for WebRTC (video conferencing like Google Meet, Zoom, Bluejeans). If you see any video artifacts you can disable VA-API for it. At about:config page set media.navigator.mediadatadecoder_vpx_enabled to false and restart browser.
  • Test different VA-API capable player, for instance mpv by running mpv —hwdec=vaapi test_clip on terminal.
  • You may also want to reset custom changes that may be intervening with HW acceleration. To do that, go to about:support and click Refresh Firefox.

Video encoding

Hardware accelerated video encoding (for WebRTC for instance) is not supported/implemented in Firefox, no matter which preference you set at about:config page.

  1. ↑ There’s also libva-intel-hybrid-driver, but that only adds support for VP8 encoding and VP9 decoding with selected chips.
  2. intel-media-driver is recommended for Intel «Broadwell (5th gen) and newer» chipsets, particularly Ice Lake (10th gen) and newer.

Copyright © 2023 Red Hat, Inc. and others. All Rights Reserved. For comments or queries, please contact us.

The Fedora Project is maintained and driven by the community and sponsored by Red Hat. This is a community maintained site. Red Hat is not responsible for content.

  • This page was last edited on 14 July 2023, at 13:22.
  • Content is available under Attribution-Share Alike 4.0 International unless otherwise noted.
  • Privacy policy
  • About Fedora Project Wiki
  • Disclaimers
  • Code of Conduct
  • Sponsors
  • Legal
  • Trademark Guidelines

Источник

Оцените статью
Adblock
detector