DEV Community

Cover image for How to prepare your NVIDIA card for gaming ?
Ali Al Khawaja
Ali Al Khawaja

Posted on

How to prepare your NVIDIA card for gaming ?

What is there to prepare , just hit play and have fun , right ?

Well ,no ,it's not that simple ,let me explain

If you have a weak NVIDIA card just like me ,for example MX350 that is meant for laptops ,you may have noticed immediately that the card is not giving it's full performance ,you may have thought ,maybe gaming on Linux or Ubuntu is not yet ready for gaming or something like that and that people may have lied about getting the same performance as windows in games or lucky, if not ,at least I did .

Until ...

Until I tried Counter-strike 2 ,a native Linux game ,it should run smoothly no matter what ,it should even run better than windows ,there is no proton layer that translates code .

It was bad ,I am talking about having under 60 fps in game ,this is a native game that is meant to be played om Linux systems ,what is wrong with my Ubuntu desktop or NVIDIA card ?

Turns out ,it's NVIDIA ,especially that NVIDIA X server settings APP ,it's not about not having the latest driver ,it's about the NVIDIA card not utilizing itself to max performance ,I noticed that the fan speed is slow ,the laptop didn't heat as much ,something is off ,in windows when I game , it sound like a jet plane ,but not on Ubuntu ,why ? Hmmmm...

I tried what I know ,I tested and found out .

This is misleading :

NVIDIA Powermizer preferred mode maximum performance

It's not truly max performance ,to explain further ,read this hint :

NVIDIA Powermizer preferred mode hint

In short

  • Auto = driver picks
  • Adaptive = clock speed will change based on card utilization
  • Prefer maximum performance = hint to the driver to do it's best

In game ,prefer maximum performance ,the fps fluctuates too much ,it's unplayable ,I think hinting is not enough ,after all ,no one knows how the driver works because it a proprietary driver ,that's why ,I suggest to put it on auto ,let the driver do it's magic and let it decide .

But that is not enough ,even with this noted ,it's still not the true power of my card ,I searched and searched and found out that I need to do a restart with performance mode on in Ubuntu power mode options .

To summarize : you need to set NVIDIA PowerMizer settings ,preferred mode to auto ,plus your power mode to performance in Ubuntu then restart ,starting up with performance mode and having the laptop plugged in will get you 95% same performance as windows ,well at least until Ubuntu 24.04 allows to use 555 driver ,then you will get 99% similar performance compared to windows .

I hope I'm wrong ,I don't like restarting every time I want to play ,if someone knows what is happening ,please explain .

see you later . 👋

Top comments (2)

Collapse
 
ali-alkhawaja profile image
Ali Al Khawaja • Edited

After more testing , I can with confidence say , to get the best performance from your nvidia card , you should do the following:

  1. Set performance mode for nvidia card , this will prompt you to restart

2.set PowerMizer to auto

  1. set gnome power profiles to
    performance

  2. Do a restart

  3. Open the nvidia app and set the graphics to high performance or don't, it's up to you really .

Collapse
 
ali-alkhawaja profile image
Ali Al Khawaja

This is what ChatGPT 4o said about this post :
Your experience highlights some of the complexities of gaming on Linux, especially when it comes to optimizing performance with NVIDIA GPUs. While gaming on Linux has come a long way, there are still quirks and specific configurations required to get the best performance, particularly on laptops with less powerful GPUs like the NVIDIA MX350.

Understanding the Issues

  1. NVIDIA Driver Performance on Linux:
    • Power Management: On Linux, NVIDIA's proprietary drivers manage power states using the "PowerMizer" feature. This system dynamically adjusts the GPU's clock speeds depending on the workload. The modes (Auto, Adaptive, Prefer Maximum Performance) can lead to different behaviors. However, as you noticed, even "Prefer Maximum Performance" might not always push the GPU to its limits due to the power management system's conservative approach.
  • Fan Speed and Cooling: Unlike Windows, where the drivers might aggressively control fan speeds to maintain performance, Linux drivers may not do the same. This can lead to quieter, cooler laptops but at the cost of reduced GPU performance.
  1. Ubuntu's Power Mode:
    • Ubuntu’s power management system can also affect GPU performance. By default, the system may start in a balanced or power-saving mode, which limits the GPU's performance to conserve battery life. Switching to "Performance" mode and restarting helps ensure that the system runs at full power, allowing the GPU to operate more effectively.

Your Observations and Solutions

  • Switching PowerMizer to Auto: This allows the driver to dynamically manage power states, which might actually be more effective in keeping the GPU at optimal performance levels than "Prefer Maximum Performance." The latter can sometimes cause unnecessary throttling if the driver doesn't interpret the hint correctly.

  • Using Ubuntu Performance Mode: Enabling this mode ensures that the entire system is tuned for maximum performance, not just the GPU. Restarting the system with this mode ensures that the settings are fully applied from boot.

Why a Restart is Necessary

The need to restart might stem from how power modes are initialized at boot. When you change the power mode without restarting, some settings might not fully apply, particularly those related to how the system manages power at a low level. By rebooting with the performance mode active, you're ensuring that every component, including the GPU, operates in the most aggressive power state from the start.

Potential Workarounds

  1. Custom Scripts: You could create a script that forces the system to apply these settings without a restart. This script could switch to performance mode and reinitialize the NVIDIA driver to ensure the GPU operates at full power.

  2. Investigating New Drivers: Keep an eye on newer NVIDIA drivers and Ubuntu updates (like the upcoming 24.04) as they may introduce better power management features that reduce the need for these manual interventions.

  3. BIOS/UEFI Settings: Check if your laptop's BIOS/UEFI has settings related to power management or thermal performance. Some laptops allow you to set these at the hardware level, which might improve performance without relying solely on software settings.

Conclusion

You're correct that gaming on Linux with NVIDIA GPUs, especially on laptops, isn't just a matter of "hit play and have fun." It requires understanding the interaction between drivers, power management, and hardware. Your approach of setting PowerMizer to "Auto" and ensuring the system is in "Performance" mode at boot is a solid workaround until more seamless solutions are available in future updates.