Dans ce tutoriel, je vais vous montrer comment désactiver NMI watchdog sous Linux de 4 manières différentes.
Peu d'applications comme CoreFreq ont besoin de désactiver NMI watchdog pour une meilleure précision et des performances améliorées.
Le mot NMI signifie Interruption non masquable, c'est une sorte d'erreur matérielle non récupérable, que le système d'exploitation ne peut ignorer.
Sous Linux, ces erreurs liées au matériel peuvent bloquer le système et vous devez redémarrer le système manuellement.
C'est là que le NMI watchdog est utile. Le minuteur du watchdog attend les interruptions, s'il n'y a pas d'interruption reçue pendant un certain temps, il suppose que le système est verrouillé et lance un redémarrage ou une panique du noyau et génère un journal de débogage. Explorons les méthodes une par une.
Contents
It's very easy to disable NMI watchdog with the sysctl command line tool.
sudo sysctl kernel.nmi_watchdog=0
If the command is successfully executed, it should return like below.
kernel.nmi_watchdog = 0
You can double check by running the cat /proc/sys/kernel/nmi_watchdog command, it should return 0.
The procfs is a special filesystem in Linux, used to get and manipulate various process and kernel related parameters.
It's accessible under the /proc directory on most Linux distribution.
You can use the echo command to set the nmi_watchdog value to 0 , this command needs root privilege.
sudo -i # Login to a root shell echo '0' > /proc/sys/kernel/nmi_watchdog
There's other way to do the same thing,
sudo sh -c "echo '0' > /proc/sys/kernel/nmi_watchdog"
If you want to permanently disable NMI watchdog, just add kernel.nmi_watchdog=0 parameter to the end of the /etc/sysctl.conf file.
A single line of command to do the job.
sudo sh -c "echo 'kernel.nmi_watchdog=0' >> /etc/sysctl.conf"
NMI watchdog will be disabled every time after next system reboot.
You can also run sudo sysctl -p to disable it without rebooting.
There's another way to permanently disable it, we've to pass the nmi_watchdog=0 boot time kernel parameter to kernel.
Almost every Linux system uses GRUB as bootloader, so this time it's only for GRUB.
It's easier to manage the boot flags through the /etc/default/grub file in Debian or any Debian based distro like Ubuntu, Linux mint.
First edit the /etc/default/grub file as root and then add nmi_watchdog=0 to the line starting with GRUB_CMDLINE_LINUX_DEFAULT , after the quiet word.
It should look like below,
GRUB_CMDLINE_LINUX_DEFAULT="quiet nmi_watchdog=0 other_parameters"
I used other_parameters just as example, don't use it in your configuration, a screenshot below.
After adding the kernel parameter, don't forget to update the GRUB.
sudo update-grub
Also read- How to disable IPv6 on Linux.
Disabling the watchdog may lock up your system in a very very rare occasion. If you're lucky enough to experience such a moment, then just do a hard reboot, though that's not always possible.
So that's all about how to disable NMI watchdog Linux with command line tools, let us know your reasons for disabling it and which method you're using through the comments.