Ubuntu 20.04 Fan Speed Control Guide For Nvidia GTX 970 And More

by JurnalWarga.com 65 views
Iklan Headers

Hey everyone! Today, we're diving into the world of fan speed control on Ubuntu 20.04, specifically for those situations where your graphics card fans might be acting up. I recently inherited an older PC with an MSI Nvidia GTX 970, and the fans were wobbling and causing inconsistent cooling. Sound familiar? Don't worry, we'll get those fans spinning smoothly and your system running cool in no time!

Understanding Fan Speed Control on Ubuntu

Fan speed control is crucial for maintaining optimal system temperatures and preventing overheating, which can lead to performance throttling and even hardware damage. Ubuntu, like most Linux distributions, provides several tools and methods to manage fan speeds. However, the process can sometimes be a bit tricky, especially when dealing with dedicated graphics cards. Before we jump into the specifics, let's discuss why fan speed control is so important and the general approaches we can take.

Think of your computer's cooling system as its lifeline. Just like a car engine needs a radiator, your CPU and GPU need effective cooling to operate at their best. When these components get too hot, their performance suffers, and in extreme cases, they can even be permanently damaged. Fan speed control is the key to keeping things cool. By adjusting the fan speeds, we can ensure adequate airflow to dissipate heat, maintaining stable temperatures and optimal performance. The default fan control settings often prioritize silence over cooling, which might be fine for light workloads but can be insufficient during gaming or other intensive tasks. That's where manual fan speed control comes in handy, allowing us to tailor the cooling performance to our specific needs.

There are generally two approaches to fan speed control on Ubuntu: software-based and hardware-based. Software-based control involves using tools and utilities to monitor temperatures and adjust fan speeds through the operating system. This is the method we'll primarily focus on in this article, as it offers flexibility and customization. Hardware-based control, on the other hand, involves physically modifying fan controllers or using external devices to regulate fan speeds. While this approach can provide more direct control, it also carries a higher risk of damaging your hardware if not done correctly. So, for most users, software-based control is the safer and more practical option. We'll explore the software options available on Ubuntu and how to use them effectively to keep your system running cool and quiet.

Identifying the Issue: Why are Your Fans Wobbling?

Before we start tweaking software, let's diagnose the problem. If your fans are wobbling, it's usually a sign of a hardware issue, not just a software configuration problem. This could be due to several factors:

  • Physical damage: The fan blades might be cracked or broken, causing them to spin unevenly.
  • Bearing wear: The bearings inside the fan motor can wear out over time, leading to wobbling and noise.
  • Dust accumulation: Dust buildup can unbalance the fan blades and impede their smooth rotation.
  • Loose connections: The fan might not be securely mounted, causing it to vibrate and wobble.

In my case, the GTX 970 fans were indeed wobbling due to a combination of dust accumulation and bearing wear. Before attempting any software solutions, I highly recommend inspecting your fans for physical damage and cleaning them thoroughly. Compressed air is your best friend here! Blow out any dust and debris from the fan blades and heatsink. If the wobbling persists after cleaning, it's likely a hardware issue that might require fan replacement. You can often find replacement fans for specific graphics card models online, or you might consider replacing the entire cooler if the fans are integrated.

However, even with new or cleaned fans, proper fan speed control is still essential for maintaining optimal cooling. So, let's move on to the software side of things and explore how we can configure fan speeds on Ubuntu 20.04.

Installing and Configuring lm-sensors

The first tool we'll use is lm-sensors, a powerful utility for monitoring hardware sensors, including temperatures and fan speeds. It's a crucial first step in gaining control over your system's cooling. To install it, open a terminal and run:

sudo apt update
sudo apt install lm-sensors

Once installed, you need to run the sensors-detect command to identify the sensors on your system. This command will probe your hardware and ask a series of questions. It's generally safe to answer "yes" to most of them, but read the prompts carefully. Run:

sudo sensors-detect

After sensors-detect completes, it will likely suggest adding some modules to /etc/modules. Follow its instructions to load the necessary modules on boot. This ensures that the sensor information is available every time you start your system. You can usually do this by running:

sudo nano /etc/modules

and adding the suggested module names to the end of the file, each on a new line. Save the file and exit the editor. Then, reboot your system or run:

sudo modprobe <module_name>

for each module to load them immediately. Now, you can use the sensors command to view the current sensor readings:

sensors

This will display temperatures for your CPU, GPU, and other components, as well as fan speeds in RPM (revolutions per minute). This information is crucial for understanding your system's cooling needs and setting appropriate fan speeds. If you see "N/A" or missing fan speeds, it might indicate that the sensors for your fans are not being properly detected. In this case, you might need to experiment with different kernel modules or consult the documentation for your specific hardware. Getting lm-sensors configured correctly is the foundation for any further fan speed control efforts, so make sure you can see the temperature and fan speed readings before proceeding.

Using fancontrol for Automated Fan Speed Management

Now that we have lm-sensors set up, we can use fancontrol to automatically adjust fan speeds based on temperature readings. This is where the real magic happens! fancontrol is a powerful tool that allows you to define temperature thresholds and corresponding fan speeds, creating a dynamic cooling system that responds to your system's workload. To install fancontrol, run:

sudo apt install fancontrol

Configuring fancontrol can be a bit tricky, as it requires editing a configuration file and defining how each fan should respond to temperature changes. The first step is to run the pwmconfig command, which will guide you through the process of identifying controllable PWM (Pulse Width Modulation) outputs for your fans:

sudo pwmconfig

pwmconfig will probe your system and ask you a series of questions, similar to sensors-detect. It will test different PWM outputs to see if they control fan speeds. Follow the prompts carefully and answer truthfully. If a fan doesn't seem to be responding, it might not be controllable through software, or it might be connected to a different PWM output. The goal is to identify the PWM outputs that correspond to your fans and confirm that you can control their speeds.

Once pwmconfig is finished, it will create a configuration file at /etc/fancontrol. This file contains the settings for how fancontrol manages your fans. You'll likely need to edit this file to fine-tune the fan speed curves. Open the file with a text editor:

sudo nano /etc/fancontrol

The configuration file is divided into sections, each defining the behavior of a specific fan. You'll see variables like PWMDEV (the PWM output), TEMPDEV (the temperature sensor), PWM_POINTS (the temperature-fan speed pairs), and MINSTART (the minimum PWM value to start the fan). The most important part is the PWM_POINTS section, where you define the fan speed curve. Each line in this section represents a temperature threshold and the corresponding fan speed (as a PWM value from 0 to 255). For example:

PWM_POINTS= 30=0  40=50  50=100  60=150  70=200  80=255

This means that the fan will run at 0% speed until the temperature reaches 30°C, then gradually increase to 50% speed at 40°C, 100% speed at 50°C, and so on, until it reaches 100% speed at 80°C. You'll need to adjust these values based on your specific hardware and cooling needs. Experiment with different settings and monitor your temperatures to find the optimal balance between cooling performance and noise levels.

After editing the configuration file, you need to enable the fancontrol service to start managing your fans automatically. Run:

sudo systemctl enable fancontrol
sudo systemctl start fancontrol

Now, fancontrol will run in the background and adjust your fan speeds based on the temperature readings. You can check the status of the service with:

sudo systemctl status fancontrol

If you make changes to the configuration file, you'll need to restart the service for the changes to take effect:

sudo systemctl restart fancontrol

Alternative Tools and Methods

While fancontrol is a powerful tool, it can be a bit complex to configure. Fortunately, there are other options available for controlling fan speeds on Ubuntu. One popular alternative is Psensor, a graphical application that allows you to monitor temperatures and fan speeds, and even set custom fan speed profiles. Psensor provides a more user-friendly interface than fancontrol, making it easier to visualize your system's thermal behavior and adjust fan speeds accordingly. You can install Psensor with:

sudo apt install psensor

After installation, run Psensor from your application menu. It will display a real-time graph of your system's temperatures and fan speeds. You can configure fan speed control by right-clicking on a fan sensor and selecting "Set fan speed". Psensor allows you to create custom fan speed profiles based on temperature thresholds, similar to fancontrol, but with a graphical interface. This can be a great option for users who prefer a visual approach to fan speed management.

Another approach is to use the Nvidia X Server Settings utility, which provides some basic fan control options for Nvidia graphics cards. This utility is usually installed with the Nvidia drivers. You can access it by running:

nvidia-settings

In the Nvidia X Server Settings, you might find a "Thermal Settings" or "PowerMizer" section where you can adjust the fan speed. However, the options available in this utility are often limited, and it might not provide the same level of control as fancontrol or Psensor. Nevertheless, it's worth checking if your graphics card supports fan control through this utility.

Finally, some motherboard manufacturers provide their own fan control utilities for Linux. These utilities are often specific to the motherboard model and might offer more advanced features than generic fan control tools. Check the documentation for your motherboard to see if such a utility is available.

Conclusion: Keeping Your System Cool and Quiet

Controlling fan speeds on Ubuntu 20.04 is essential for maintaining optimal system temperatures and preventing overheating. Whether you're dealing with wobbling fans, noisy cooling, or simply want to fine-tune your system's performance, the tools and methods we've discussed in this article will help you achieve your goals. Remember to start by diagnosing any hardware issues, such as dust accumulation or bearing wear, and then move on to software-based fan speed control using tools like lm-sensors, fancontrol, and Psensor. Experiment with different settings and monitor your temperatures to find the perfect balance between cooling performance and noise levels. With a little effort, you can keep your system running cool, quiet, and efficient for years to come. Happy tweaking, guys!