ThinkPad W540 on Fedora 40: Overcoming Computer Halts Performing Specific Tasks
If you're like me, you've upgraded to a newer, more powerful PC, but still have a ThinkPad W540 running Fedora 40. I found that while it's not my daily driver anymore, it's still a valuable machine for specific tasks. However, I recently encountered some issues where the computer would halt while performing certain tasks. This article will discuss the steps I took to overcome these halts, focusing on the global topic of optimizing a ThinkPad W540 on Fedora 40 for specific tasks.
Identifying the Issue
After installing Home Assistant as a virtual machine on my macOS server, I decided to use my old ThinkPad W540 for running Z-Wave JS, a JavaScript binding for Home Assistant that allows communication with Z-Wave devices. However, I soon realized that the computer would halt during specific tasks, such as booting up or running resource-intensive applications.
Investigating the Cause
To investigate the cause of these halts, I first checked the system logs using the journalctl command. I noticed several errors related to the CPU, specifically the cpu_frequency driver. I suspected that the CPU frequency scaling governor was set to ondemand, which can cause performance issues and halts on older hardware like the ThinkPad W540.
Resolving the Issue
To resolve the issue, I changed the CPU frequency scaling governor to performance. This change ensures that the CPU always runs at its maximum frequency, preventing halts during resource-intensive tasks. Here's how to make this change:
- Check the current governor using the following command:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor- Restart the CPU frequency scaling service using the following command:
sudo systemctl restart cpu-freq.service- Change the governor to
performanceusing the following command:
sudo echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor- Confirm the change by checking the governor again:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governorOptimizing for Z-Wave JS
Now that the ThinkPad W540 was no longer halting during resource-intensive tasks, I was able to run Z-Wave JS without any issues. To optimize the system further, I installed Node.js version 16.14.0, which is the recommended version for Z-Wave JS. I also allocated 4GB of RAM to the virtual machine, ensuring that it had enough resources to run smoothly.
In this article, we discussed how to overcome computer halts on a ThinkPad W540 running Fedora 40. By changing the CPU frequency scaling governor to performance, we were able to prevent halts during resource-intensive tasks. We also covered optimizing the system for running Z-Wave JS as a virtual machine.
References
- CPU frequency scaling: https://wiki.archlinux.org/title/CPU_frequency_scaling
- Z-Wave JS: https://www.npmjs.com/package/zwave-js
- Node.js version 16.14.0: https://nodejs.org/dist/v16.14.0/