Significant Performance Boost in glmark2 with NVIDIA GPU-only BIOS Setting | F41 | Hybrid Graphics

Hello Fedora team,

I’m currently running Fedora 41 on an Alienware laptop with an NVIDIA GeForce RTX 4090 GPU. I’ve encountered an issue where, to achieve optimal graphics performance, I had to disable hybrid mode in the BIOS and switch to using the NVIDIA GPU exclusively. This change led to a significant increase in my glmark2 benchmark scores, and I wanted to share my findings in case it’s helpful for others or if there’s a better solution.

With hybrid mode enabled (both integrated and NVIDIA GPUs active), my glmark2 scores were consistently around 4,000. I tried several methods to force glmark2 to use the NVIDIA GPU, including:

  • Running with the DRI_PRIME=1 prefix
  • Setting the _GLX_VENDOR_LIBRARY_NAME=nvidia and _NV_PRIME_RENDER_OFFLOAD=1 environment variables to use NVIDIA drivers

Unfortunately, despite these attempts, my performance did not improve significantly.

After switching the BIOS to use the NVIDIA GPU exclusively (disabling hybrid mode), my glmark2 score skyrocketed to 22,000 — a massive improvement. This suggests that Fedora’s hybrid GPU management might not be fully optimized for my system configuration.

Here’s a breakdown of the methods I tried and the results:

  • Method 1: Running glmark2 normally with hybrid mode enabled — 4,000 score
  • Method 2: Using DRI_PRIME=1, _GLX_VENDOR_LIBRARY_NAME=nvidia, and _NV_PRIME_RENDER_OFFLOAD=1 — 4,000 score
  • Method 3: Modifying the BIOS to GPU-only mode — 22,000 score

Given this huge performance difference, I’m wondering if there’s a more efficient way to utilize hybrid GPUs on Fedora without toggling BIOS settings. I’d appreciate any advice or if anyone else has experienced similar issues.

Thanks for your help and if you need any specific information, please don’t hesitate to ask.

±----------------------------------------------------------------------------------------+
| NVIDIA-SMI 560.35.03 Driver Version: 560.35.03 CUDA Version: 12.6 |
|-----------------------------------------±-----------------------±---------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4090 … Off | 00000000:01:00.0 On | N/A |
| N/A 45C P4 28W / 125W | 1222MiB / 16376MiB | 11% Default |
| | | N/A |
±---------------------------------------


+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 560.35.03              Driver Version: 560.35.03      CUDA Version: 12.6     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090 ...    Off |   00000000:01:00.0  On |                  N/A |
| N/A   45C    P4             28W /  125W |    1222MiB /  16376MiB |     11%      Default |
|                                         |                        |                  N/A |
+----------------------------------------

This is not a problem and has worked this way since the driver was capable of being switched around Fedora 25ish, switcherooctl can be used to launch your application explicitly on a particular gpu if you need it. Outside of that, in Hybrid Mode, you will alway be on the iGPU/APU unless the application needs it. This is done mostly for battery savings sake.

If you want to test, go back to Hybrid mode, and once you are on the desktop use switcherooctl and the application you want to test. Also, you can explicitly launch with “Discrete Graphics” from the application menu.

Here are some examples:

Blender launches with the Discrete GPU, but you can use the integrated one if needed:

Screenshot from 2024-06-21 16-01-17

Krita launches with Integreted Graphics but you have the option to launch with “Discrete Graphics”

Screenshot from 2024-06-21 16-01-29

So you can test with switcheroolctl glmark in Hybrid mode to see the results you want.

Added switcherooctl

Thank you for your response. If I may ask an additional question, I thought that the switch would be automatic when the application(glmark2) stressed the mesa GPU?

Your solution, would it be required to play graphic games, such as those on steam, or would you also need to do some manual intervention to utilize the nvidia card?

If the only impact is battery, I really don’t see a reason to use hybrid graphics just to save battery because 99% of the time, I am plugged in.

I edited your original post and copied the nvidia-smi data into a block that is formatted using the preformatted text tags. Please note the difference in readability of that information.

The preformatted text tags are available using the </> button on the toolbar of the text input window or by using triple backquotes [ ``` ] on the line preceding the text and on the line following the text. Simplest use is to paste the text then highlight it and click on that </> button

It aids readers extremely to see the data as shown on your screen.

For your use case (a desktop replacement), You are probably ok with the performance and battery consumption. Your issues would arise for different reasons, If you are always plugged in, battery maintenance would need to be considered.

In my case, as in the example above, Blender is already designed to work with the GPU for acceleration, Krita is not that way, but I can use it If I need it. Steam is also like this. So the games typically do launch this way as well.

There are edge cases for this where the iGPU/APU takes over, but those are handles in other ways.

The general consensus is battery life/preservation when in these types of laptops.