From Mageia wiki
Revision as of 11:57, 7 March 2021 by Morgano (talk | contribs) (Hybrid Graphics)
Jump to: navigation, search


Drakconf multiflag.png
Other languages
English ; Español ; français ;

Hybrid Graphics

Some laptops comes with "Hybrid Graphics", meaning they have two GPU: one is usually "internal" (or "integrated") into the CPU, and is called IGP (Integrated Graphic Processor), and the other is "dedicated", external to the CPU, and it is called "discrete" (DGP, Discrete/Dedicated Graphics Processor). The integrated is power efficient, while the discrete is faster.

Owners of NVIDIA Optimus laptops (integrated Intel or AMD/ATI CPU+GPU, plus a discrete NVIDIA GPU) now have three ways to benefit from the power of their NVIDIA GPU:

  • The free Nouveau drivers support Prime GPU offloading out of the box, which can be used via the DRI_PRIME=1 environment variable (unless the proprietary NVIDIA driver is in use by, e.g., Mageia-prime). Refer to the Nouveau documentation to see how to configure Xorg to use NVIDIA Prime with DRI3.
  • The Bumblebee package can be used to bridge the monitor to the NVIDIA GPU, allowing to access its processing power albeit with some overhead.
  • This new tool Mageia-prime for Optimus described on this page can be used to configure the NVIDIA Prime supported by recent Linux kernels and Xorg servers. It allows to fully switch to using the NVIDIA GPU without the overhead of Bumblebee, and is particularly suited for use with CUDA.

In all three cases, when configuring the graphics drivers, one must during install and the usual Mageia tools configure only the integrated GPU (at least in most Optimus configurations), as it is typically the only one physically connected to a monitor. (If failing, try the other way around.)

Mageia-prime

Mageia-prime is a tool which allows you to easily configure NVIDIA Prime for using the discrete graphics card with the NVIDIA proprietary drivers within the Mageia GNU/Linux distribution.

Actually there are four combinations of configurations NVIDIA/Intel. Between all the combinations, the most popular is considering the NVIDIA laptop graphics card in a way similar to a desktop card.

Using NVIDIA card alone

Quick instructions are:

  • configure your card as usual as an Intel card from XFdrake (or MCC).
  • run from a terminal with root privileges and then reboot:
mageia-prime-install
reboot
Note:
The option '-3' (i.e. mageia-prime-install -3') will force using the nvidia390, but normally it is detected. This driver is yet untested on a real "390.xx" card. Feedback is welcome.

If everything works fine, at next reboot, you'll get the Xorg configured as NVIDIA. You can check that the switch has actually been executed, running for instance one of the following utilities: glxinfo, glinfo, clinfo, nvidia-settings, cuda-z, checking /var/log/Xorg.0.log, typing "about:gpu" in chromium-browser, typing "about:support" in firefox, and some further benchmark like glxgears, glxspheres64, glmark2, etc., which should show also the increase of performance. blender should also work with CUDA rendering in Cycles.

  • to go back to the integrated GPU, run:
mageia-prime-uninstall

Switching between cards

Once all the kernel modules are built, you can quickly switch back and forth between NVIDIA and the inegrated GPU, without rebooting, but just by restarting X11, using:

mageia-prime-install -z
mageia-prime-uninstall -z

which will zap X11 for you.

Offloading

With NVIDIA driver version >= 435.xx you can use prime render offloading, which starts X11 with the integrated GPU, and render with NVIDIA GPU:

https://download.nvidia.com/XFree86/Linux-x86_64/460.39/README/primerenderoffload.html

The option for enabling it with 'mageia-prime-install -p' instead of just 'mageia-prime-install', and then render, is using:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <application>

and there is a wrapper for doing the same with

mageia-prime-offload-run <application>

Note that in this way some application would work (e.g. benchmark works), some other doesn't, e.g. if you start chromium-browser under prime offload, you get it don't starting with acceleration enabled as you can check with "about:gpu". We are not sure why this happens, probably because there aren't available all the GLX visuals in offloading mode. Also in this way the performance are not that different from the integrated card, though this might depend on which integrated and which NVIDIA card you have. If you have a GTX 3080 mobile probably the offloading is faster anyway.