Comment by adrian_b
9 hours ago
I have heard frequently complaints about NVIDIA drivers on Linux, but I always wonder about which are the exact circumstances in which such problems can appear.
I have used NVIDIA GPUs on Linux continuously since 2005, i.e. for 21 years.
During this time I have been using more than a dozen different kinds of desktop NVIDIA GPUs, both GeForce and Quadro (I have multiple computers). I have also used several kinds of laptops with NVIDIA GPUs, both GeForce and Quadro, from Dell and from Lenovo. I have also used NVIDIA Jetson SBCs, with NVIDIA Volta GPUs.
On all these many kinds of hardware and during these 21 years, I have never had any problem with the NVIDIA GPUs, either on Linux or on FreeBSD (NVIDIA is among the few hardware vendors who also provide FreeBSD device drivers).
On the other hand, I have had various problems with my AMD GPUs, or, more rarely, with my Intel GPUs (OpenGL defects on both, while with certain AMD GPUs I had problems in multiple monitor configurations).
Today I have more AMD GPUs than NVIDIA GPUs, but that is because I use the AMD GPUs for computational purposes, while the NVIDIA GPUs are used for graphics.
I use many programs based on OpenGL, and the quality of the graphics has always been perfect with NVIDIA GPUs, while in the past it was quite bad on both AMD GPUs and Intel GPUs, regardless whether the "professional" closed-source AMD drivers were used, or their open-source drivers. By bad I mean that the AMD and Intel GPUs failed to render correctly some complex images drawn with OpenGL, unlike the NVIDIA GPUs, which were flawless. The quality of the AMD and Intel drivers has improved a lot in recent years, but I have not checked whether now they really match the NVIDIA drivers in all cases.
While the above was about OpenGL, where there has never been any doubt that the NVIDIA device drivers are the best, regarding video, there is more than a decade since I have never used any monitors that are not 4k resolution, 10-bit per color component and P3-D65 (Display P3) wide color gamut. I frequently watch various high-resolution movies, using various kinds of video codecs on an NVIDIA GPU and the quality of rendering has always been impeccable. Though unlike with OpenGL, with video I also do not remember ever having any problem on Intel GPUs.
I do not doubt that there must be cases when NVIDIA does not work well on Linux, but I am certain that those are never caused by the NVIDIA drivers alone, but by some interaction with other installed software that may have been written to work only with other GPUs.
For example, even if some years ago Firefox had worked with my NVIDIA GPU, that got broken at some point and for the last few years Firefox claims to not detect any GPU, so WebGL and hardware video decoding do not work, and all efforts to force their enabling in the Firefox configuration have failed, even if other browsers like Chromium and Vivaldi work perfectly and a great number of other graphics or video programs also work perfectly. Firefox is the only program that I have ever used and that has not worked fine with NVIDIA GPUs.
I certainly assign this bug to Firefox, not to the NVIDIA drivers, which also work perfectly with the programs that I write myself.
Among the Linux kernel developers, there are some who for some weird reason have sabotaged the NVIDIA drivers from time to time for many years, by making various gratuitous changes in the Linux kernel API for device drivers, designed with the precise purpose of breaking the existing NVIDIA drivers.
Every time when this happens, the NVIDIA drivers fail to work with the new Linux kernel version, but that is no fault of NVIDIA. This creates an additional work for the NVIDIA maintainers, who must release a new version of the NVIDIA device drivers, as soon as they succeed to design a workaround for the Linux API changes. The workaround may be difficult, because in many cases the Linux kernel has stopped exporting certain functions used by the NVIDIA driver, restricting their use to device drivers with different code licenses. This export conditioned by the license of the driver that imports it has no legal basis and no relationship whatsoever with the requirements of the GPL.
This is the reason why some people claim that they could not boot some Linux system with certain NVIDIA drivers. I also assign this fault to the Linux kernel developers who had intentionally broken the NVIDIA device drivers, which I consider a childish and unprofessional behavior. There is no doubt that NVIDIA cannot be criticized when this happens.
To be clear, I consider that it is extremely bad and undesirable to run on your computer any privileged code, e.g. a device driver, which is not open source.
However, this policy should not be something that kernel developers enforce by artificial restrictions. They should try to educate their users to avoid unsafe closed source device drivers, but when a user has serious practical reasons to make an exception, that should be the user's decision, and it is not the role of a kernel maintainer to forbid this.
I have used Linux equally long, Nvidia on my last 3 or 4 systems. They all had problems with very sporadic hard crashes (full system freeze so hard magic sysrq keys don't work, and nothing is visible in the logs. Sometimes with audio looping.) It doesn't happen often, rare enough that I sometimes fooled myself into thinking I'd found and solved the issue. But then 4 months down the road, often with a driver update, suddenly they're back.
>They all had problems with very sporadic hard crashes
I had such an issue recently, on a laptop with an Intel igpu and an Nvidia primus card.
I'm not a coward, so I debugged the system, and found that the crash was caused by the Intel i915 driver trying to do some tricky hdmi related mumbo jumbo with the hdmi port that wasn't even connected to the igpu, it was connected to the nvidia gpu.
When I contacted intel bugtracker, they just said "ah, Nvidia... well, even though their kernel module is open, it's not on the mainline kernel, so go fsck.ext2fs yourself".
I have also seen extremely rare cases of Linux freezes exactly like you described, and I have wondered if there can be any relationship between them and the NVIDIA drivers, mainly because they are the only closed-source drivers that I use.
Nonetheless, I have not seen any evidence about such a relationship. The freezes never occurred while the computer works alone and some program uses the GPU. In all cases the freezes happened right after some quick mouse movement.
The culprit is definitely somewhere in the device drivers, and it cannot be excluded that this may have something to do with NVIDIA, because I do not remember if I have ever seen identical freezes with AMD or Intel GPUs, but that could be just because I have spent less time using directly such computers, instead of using them remotely through SSH.
In any case, this bug is something that requires interactions with the mouse driver, perhaps also with the keyboard driver, and the X server might also have some role.
In such cases, network and HDD/SSD activities appeared to continue normally, only the display was frozen and the keyboard and mouse did not respond. While the initiator could have been something done by the X server, something was stuck in the kernel, because not even the keys that should be intercepted by the kernel worked, as you have also said.
This is certainly a bug whose cause has not be discovered for many years, but it is not yet clear whether it really has anything to do with NVIDIA, since its main effects are upon keyboard and mouse.