Only the user mode part of the driver is replaced, the kernel interface is actually shared between the closed source and the open source driver. So it's just loaded like a DLL/.so and hooked up to the API.
This is only possible because of a very specific quirk of Linux: the interface between the kernel and user mode halves of the GPU driver is considered as sacrosanct as normal Linux syscalls[0]. If you want to get a graphics card driver in kernel you have to get your driver's UAPI approved by the kernel maintainers because it will be supported in Linux until the end of time.
No other operating system does it this way, nor will this work on Nvidia proprietary drivers. Everywhere else, the point of demarcation for graphics is OpenGL, DirectX, Metal, or Vulkan entrypoints in userspace. To be clear, there IS a UAPI here too - hardware isolation demands it - but it breaks constantly and nobody bats an eye. If you were willing to deal with that fragility, you could do the same trick on Windows or macOS.
[0] For those unaware, Linux has a very explicit policy of never breaking userspace. That means no ABI changes whatsoever.
> For those unaware, Linux has a very explicit policy of never breaking userspace
But has no qualm with constantly refactoring the kernel side of the coin for the most minor of reasons, which causes endless trouble when it comes to supporting out of tree drivers and is the true reason why Android will never be able to provide long term support. SOC manufacturers are not interested in the churn involved in updating their drivers to support the newer kernels that come with new android versions. Most often, it's because they want to keep their driver proprietary, but it is not the only reason, there is a cold hard truth about the nature of the market: new phones are released at a high cadence, while the process of mainlining a driver into upstream linux kernel is arduous, depending on the attitudes of kernel maintainers, truly painful, and no company out there could see any value in waiting for this process to end before releasing their hardware onto the market. Since they're already going to make it out of tree and release it as is, why would they bother? a year later, they'll repeat this process again, and again. Then Android updates, and the devices are obsoleted.
On the other hand, you can install the latest GPU driver on Windows 10 just fine, and it is the same driver as the one on 11. Windows doesn't constantly break your not-maintained-by-microsoft drivers with newer versions of their kernel.
kmeisthax|2 years ago
No other operating system does it this way, nor will this work on Nvidia proprietary drivers. Everywhere else, the point of demarcation for graphics is OpenGL, DirectX, Metal, or Vulkan entrypoints in userspace. To be clear, there IS a UAPI here too - hardware isolation demands it - but it breaks constantly and nobody bats an eye. If you were willing to deal with that fragility, you could do the same trick on Windows or macOS.
[0] For those unaware, Linux has a very explicit policy of never breaking userspace. That means no ABI changes whatsoever.
zirgs|2 years ago
And when someone tries to do it - Linus gets very angry. https://lkml.org/lkml/2012/12/23/75
ftaghn|2 years ago
But has no qualm with constantly refactoring the kernel side of the coin for the most minor of reasons, which causes endless trouble when it comes to supporting out of tree drivers and is the true reason why Android will never be able to provide long term support. SOC manufacturers are not interested in the churn involved in updating their drivers to support the newer kernels that come with new android versions. Most often, it's because they want to keep their driver proprietary, but it is not the only reason, there is a cold hard truth about the nature of the market: new phones are released at a high cadence, while the process of mainlining a driver into upstream linux kernel is arduous, depending on the attitudes of kernel maintainers, truly painful, and no company out there could see any value in waiting for this process to end before releasing their hardware onto the market. Since they're already going to make it out of tree and release it as is, why would they bother? a year later, they'll repeat this process again, and again. Then Android updates, and the devices are obsoleted.
On the other hand, you can install the latest GPU driver on Windows 10 just fine, and it is the same driver as the one on 11. Windows doesn't constantly break your not-maintained-by-microsoft drivers with newer versions of their kernel.
Rhedox|2 years ago
sylware|2 years ago
BTW, the NVIDIA opensource vulkan driver was dropped in mesa...