4 ms·
I would also mention that gpus are a GIANT abstraction, and since they are rev'd faster than arguably any hardware in a sytem, there are abstractions layered on
by m463 6y ago
I would also mention that gpus are a GIANT abstraction, and since they are rev'd faster than arguably any hardware in a sytem, there are abstractions layered on top of that for the families and models of gpus too.
Another way of looking at it is -- I started playing with openwrt for a relatively small router, with 5 ports plus wifi.
I was amazed at not only the amount of openwrt code required to support the different router families and the different router models, but at the sheer amount of stuff turned on by default in the kernel just in case I might need to load a module for some obscure feature or package. I assume the same goes for a gpu driver both at the source level and in the kernel.
- andromeduck 6y agoYeah AMD/NV typically do 2-3 chips per year. That complexity adds up pretty quickly when backwards/forwards compatibility is fairly strict and the inputs/abstractions not particularly well defined or behaved.
- simfoo 6y agoI'm wondering at which point it would make sense to split the driver into multiple device family drivers instead of lumping it all together into a mess of unmaintainable abstractions.
- rurban 6y agoThe opposite. The lack of abstractions, mere industrial copy pasta code is the problem.
- andy_ppp 6y agoI’m not saying it’s true here but duplication over the wrong abstraction is always better. Seems to me if each graphics card is different enough there’s probably lots to duplicate.
- VBprogrammer 6y agoIn software development absolutes are always dangerous.
- andy_ppp 6y agoApart from absolutes about absolutes.
- rurban 6y agoNonsense. This duplication is not maintainable and needs massive amounts of memory. Proper abstraction adds a few if else in the data, and is about 20x smaller. You can even read and understand that, e.g. what changed with this HW upgrade. No chance with duplicated blobs of structs and enums.
- andy_ppp 6y ago> I’m not saying it’s true Yes, I did caveat my suggestion. Why not submit a fix if it's so simple ;-)
- mrweasel 6y agoIf the Radeon driver is in the kernel now, then maybe at some point someone other than AMD will pick it up and start cleaning up excessive copy paste code. Assuming they play nice with the community, it could be a huge benefit to AMD in the long run. Still, 2 million lines is a massive amount of code to start working on.
- samus 6y agoUnlikely, unless that entity has all the supported hardware at hand and ready for automated tests. Refactoring without a thorough test harness is ref*toring.
- jimmySixDOF 6y agoisn't that what Google are hoping to do with Fuchsia to make a next generation of Android that's not dependant on device drivers in the kernel ?
- junon 6y agoI can't see how they'd be able to achieve that, unless you mean simply that the device drivers would run in userland.
- CyberDildonics 6y agoReinventing QNX will always be cutting edge
- inopinatus 6y agoAt the point where people are making jokes about the Linux kernel making up X% of the GPU driver.
- de_watcher 6y agoAre there still workarounds for specific games/programs inside the driver?
- TheFlash 6y agoYes. In fact, that's essentially what the drivers are.
- psykotic 6y agoLeaving aside arguments about "what the drivers are", the kernel driver being discussed here generally doesn't have or need that kind of thing. The user-space drivers which talk to the kernel drivers are under the Mesa umbrella as part of Gallium for OpenGL and Direct3D support (e.g. https://github.com/mesa3d/mesa/tree/master/src/gallium/drivers/radeonsi https://github.com/mesa3d/mesa/tree/master/src/gallium/drive...) or as a standalone driver for Vulkan support (https://github.com/mesa3d/mesa/tree/master/src/amd/vulkan https://github.com/mesa3d/mesa/tree/master/src/amd/vulkan). That said, I haven't seen many app-specific hacks in the open source drivers, even in the user-space code. If anyone wants to learn more about lower-level aspects of GPUs, the Vulkan driver code I linked is one of the best places to start. It directly implements the Vulkan API on one end and talks to the kernel drivers on the other end, so it's relatively easy to follow if you're a systems programmer with an API-level understanding of graphics. Just pick a Vulkan function of your choice and start tracing through the code, e.g. vkCmdDraw: https://github.com/mesa3d/mesa/blob/master/src/amd/vulkan/radv_cmd_buffer.c#L5365 https://github.com/mesa3d/mesa/blob/master/src/amd/vulkan/ra.... The Vulkan driver calls into some of the low-level radeonsi code I linked from the Gallium tree but it isn't a Gallium-based driver, so you don't have to deal with those extra layers of abstraction.
- account42 6y ago> That said, I haven't seen many app-specific hacks in the open source drivers, even in the user-space code. They are enabled via driconf [0]. Not nearly as many as what I imagine you'd find in the proprietary Windows drivers though. [0] https://github.com/mesa3d/mesa/blob/master/src/util/00-mesa-defaults.conf https://github.com/mesa3d/mesa/blob/master/src/util/00-mesa-...