|
|
Log in / Subscribe / Register

Rosenzweig: Writing an open source GPU driver – without the hardware

Here's a war story from Alyssa Rosenzweig on the process of writing a free driver for Arm's "Valhall" GPUs without having the hardware to test it on.

In 2021, there were no Valhall devices running mainline Linux. While a lack of devices poses an obvious obstacle to device driver development, there is no better time to write drivers than before hardware reaches end-users. Developing and distributing production-quality drivers takes time, and we don’t want users to be reliant on closed source blobs. If development doesn’t start until a device hits shelves, that device could reach “end-of-life” by the time there are mature open drivers. But with a head start, we can have drivers ready by the time devices reach end users.


to post comments

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 28, 2022 3:20 UTC (Fri) by mcon147 (subscriber, #56569) [Link] (3 responses)

I'm surprised ARM doesn't feel motivated to provide a driver themselves

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 28, 2022 4:15 UTC (Fri) by JoeBuck (subscriber, #2330) [Link] (2 responses)

They provide a proprietary driver, which is part of what is being reverse engineered here.

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Feb 10, 2022 16:40 UTC (Thu) by mrugiero (guest, #153040) [Link] (1 responses)

I'm surprised any hardware company still thinks closed source drivers are the way to go :shrug:

I'm not convinced that they either create patent problems (those are about usage and they don't need to release under patent license granting software licenses), they could and should negotiate open sourcing of whatever 3rd party code made for them, they don't really give enough info about the hardware for competitors to exploit (plus, patents may cover the juicy bits and reverse engineering efforts can happen whether you provide closed or open drivers anyway) and making them open source is an extra incentive to buy the hardware because it opens up an (at worst, slightly) extra portion of the market, and they make money selling hardware, not selling software.

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Feb 10, 2022 22:36 UTC (Thu) by Wol (subscriber, #4433) [Link]

You're forgetting the nightmare that is software patents. Hopefully they've been killed stone dead by now, but they have a habit of rising like zombies ...

Cheers,
Wol

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 28, 2022 7:16 UTC (Fri) by Fowl (subscriber, #65667) [Link] (8 responses)

Amazing work!

I wonder who the client/who is funding this work, given that there are are already both released Android and ChromeOS devices. Or does Collabora have some sort of "in between projects", "20% time" or "giving back" type program?

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 28, 2022 9:51 UTC (Fri) by atnot (guest, #124910) [Link] (7 responses)

I would expect the way it works is that Collabora has customers for Panfrost, which funds maintainance and development to keep the driver relevant to current and future clients.

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 28, 2022 15:00 UTC (Fri) by daniels (subscriber, #16193) [Link] (6 responses)

Yeah. We can’t always talk about the specific commercials of each project, but for our larger work (Panfrost, Wayland, GStreamer, kernel hardware enablement, etc) it’s always a mix of customer-funded and work we just do ourselves.

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 28, 2022 18:08 UTC (Fri) by tuna (guest, #44480) [Link] (5 responses)

Maybe you can't answer this, but who pays for the work you "just do ourselves"?

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 29, 2022 10:24 UTC (Sat) by farnz (subscriber, #17727) [Link] (4 responses)

Not a Collabora employee, but have worked in tech firms a long time; lots of software consultancies (and Collabora is a consultancy) do a certain amount of work paid for out of their profit margins on paid jobs as a form of advertising their own abilities.

The point for Collabora is that much of their paid work will be under NDAs, and thus they can't show it to potential customers. The work they do out of their own profit margin is not under NDA, and thus can be shown to potential customers. This blog post is a perfect example - Collabora is paid to provide a driver with full source for some ARM Mali GPUs to a customer under NDA. If we knew which SoCs were involved, it wouldn't be that hard to work out who the customer is - but that's something Collabora can't let out of the bag due to its NDA. By working on Mali drivers out of its own funds, too, Collabora has a set of examples of how it can produce Mali drivers for any SoC of interest to you without putting itself anywhere near the customers with NDAs.

This is important to potential customers; they want to know that Collabora is able to respect the NDAs it signs, and they also want to know that Collabora can do the job they want to hire them for. If Collabora was only able to show off SoCs it did drivers for under consulting NDAs, then there's a good chance that Collabora customers under NDA would be identified, which is bad for Collabora's business. If it had nothing to show off, then how do I convince management that Collabora can do the job? Hence paying out of profits to ensure that sales can go in with something I can show management, and that doesn't give their existing customers' legal teams the heebie-jeebies (which is bad for maintaining relationships).

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 29, 2022 11:35 UTC (Sat) by mjg59 (subscriber, #23239) [Link] (2 responses)

Also not a Collabora employee, but did a small amount of contract work for them in 2008, and for a period in 2005 the company was running out of my living room: all of this is true, but there's also a social aspect to this. Consultancies like Collabora have an incentive to work on enhancing free software because that's a good way to attract potential employees who are interested in free software, and demonstrating that they'll be paid to do so even if some of their work is on NDAed proprietary code distinguishes them from many alternative options. Companies don't just signal to customers, they signal to talent.

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 30, 2022 21:26 UTC (Sun) by nedrichards (subscriber, #23295) [Link] (1 responses)

This is especially true. I was at Collabora between 2014-15 and spent a lot of time talking about this. Most of the people could work elsewhere for more money if they wanted to - so why do they not? Back then being remote first was a competitive advantage (maybe less so in 2022!), having a free software first culture, an amount of self directed research and work on projects you found to be important, fewer meetings than being a full time employee 'client side'. It's a different mix for different people! But for a consultancy you are your people and the extent to which you can attract them to work on meaningful, difficult projects that one customer couldn't justify, but a number of them together could - that's a net win for them and for the community.

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Feb 10, 2022 16:45 UTC (Thu) by mrugiero (guest, #153040) [Link]

How does one get around working on the more open side of Collabora? Asking for a friend :eyes:

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 29, 2022 22:06 UTC (Sat) by daniels (subscriber, #16193) [Link]

This is pretty accurate. Most of the paid work we do does go upstream into the various projects we work on, it's just the product context that isn't discussed publicly - be it because the product hasn't actually been disclosed to the market yet (e.g. some of the video codec and GStreamer work we're doing right now), or just because the manufacturer prefers not to disclose their inner workings and supply chains (e.g. some of the Panfrost enablement and fixes).

The work we do outside of customer projects usually falls into one of three buckets: cleaning up and upstreaming work we weren't able to get upstream during a customer project (because of deadline, or because it was waiting for review, or needed rework / additional support work), general maintenance and gardening to keep upstream projects relevant and healthy, or because we've decided to make a deliberate investment in a particular project.

It is good advertising, but it's also about keeping open source healthy and relevant. For larger projects, it's often hard to convince people to sink so much money/time into foundational work, so we often do that larger work outside of customer projects to make sure the project remains competitive with proprietary solutions, and open source remains a good choice.

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 28, 2022 18:57 UTC (Fri) by swilmet (guest, #98424) [Link]

I remember this:
"Vetter: Upstream Graphics: Too Little, Too Late"
https://lwn.net/Articles/806892/

> For some hardware upstreaming early enough is possible, but graphics simply moves too fast: By the time the upstreamed driver is actually in shipping distros, it’s already one hardware generation behind.

So I think the situation is getting better, technical solutions are found, that's good news for the open-source Linux graphics stack!

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 29, 2022 20:21 UTC (Sat) by bjartur (guest, #67801) [Link] (2 responses)

How is this legally different from decompiling a driver? Is the Panfrost driver not derived from the reverse-engineered driver?

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Jan 30, 2022 12:14 UTC (Sun) by randomguy3 (subscriber, #71063) [Link]

IANAL, but I would imagine the distinction is that they're looking at behaviour, not instructions (ie: code). There are multiple ways to achieve the same behaviour (some of which may be more efficient than others), but copyright only covers expression - so the particular code you wrote. Based on the blog, they're not looking at the code (which is what is copyrighted), but at the behaviour of that code given certain inputs (which can't be copyrighted).

Rosenzweig: Writing an open source GPU driver – without the hardware

Posted Feb 1, 2022 13:38 UTC (Tue) by nim-nim (subscriber, #34454) [Link]

As long as they only dissect and reuse the low-level instructions they are pretty safe. You can’t be sued for talking to hardware the only way it understands.

If they tried to copy the optimization logic of the proprietary driver they may end up in hot water but they are not interested in that. They’re reusing and evolving a floss core written for other chips. That means that first, they can reuse past know-how (unlike proprietary ISVs that fork and abandon drivers) and second they can prove to the law their driver history is mostly independant from what they learnt from the latest proprietary driver.


Copyright © 2022, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds