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: <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7140424747094647493147415f41190b">[email protected]</a>
       GLX Renderer: GeForce GT 630M/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 384.90 Direct Rendering: Yes

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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

with the the content:

Section "Extensions"
    Option "GLX" "Disable"
EndSection

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

Method 2

The solution above didn’t work for me. It caused an error on boot to the effect of unw_get_proc_name failed. I don’t know if this happened for anyone else, but I found a different solution.

I modified /usr/share/X11/xorg.conf.d/10-nvidia.conf. For me, the file contained the following pre-edit:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "Accel" "off"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection

I added a line below Option "AllowEmptyInitialConfiguration": Option "Accel" "off". Using this modification instead of the solution above, my system booted and nvidia-smi didn’t show Xorg anymore.

Hope this helps somebody.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x