Implementing graphics drivers..

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
newosdeveloper2021
Posts: 15
Joined: Sat May 01, 2021 8:47 pm

Implementing graphics drivers..

Post by newosdeveloper2021 »

I'm wondering about any nvidia documentation, I'm a great reverse engineer but it's obviously a waste of time. So I'm wondering if you need to develop your OS to a certain point, and then ask them to make a driver/give you documentation under certain conditions as i heard claims about that and people claiming to have the documentation

If not, do I just have to develop my OS enough and ask them?
User avatar
mid
Member
Member
Posts: 31
Joined: Thu Mar 04, 2021 7:25 am

Re: Implementing graphics drivers..

Post by mid »

newosdeveloper2021 wrote:I'm wondering about any nvidia documentation, I'm a great reverse engineer but it's obviously a waste of time. So I'm wondering if you need to develop your OS to a certain point, and then ask them to make a driver/give you documentation under certain conditions as i heard claims about that and people claiming to have the documentation

If not, do I just have to develop my OS enough and ask them?
I would think you'd need a considerable market share and wealth for it to even be considered.

Must it be NVidia? Intel may have horrible GPU documentation (although the i815 docs seem alright), but at least they're freely accessible.
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: Implementing graphics drivers..

Post by Ethin »

NVIDIA is the last company who would give you documentation to their hardware. They're incredibly anal about it for some reason. The fact that Linux needed to make an open-source driver *before* NVIDIA gave us drivers for Linux, if memory serves, should tell you something. Even if you have a considerable market share they're unlikely to give you docs. The intel docs are horribly organized (especially given the fact that they organize registers alphabetically instead of by address like every other company out there) but those (and the AMD GPU docs) are where you should probably start. If you can't get the latest AMD GPU docs I think that they'll give you them if you email their open-source GPU driver development email.
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Implementing graphics drivers..

Post by Schol-R-LEA »

You might consider looking at the source code and documentation for the Nouveau drivers, which are from an existing reverse-engineering project for Linux. They are far from what the closed-source Nvidia drivers are, but they would be the best - indeed, in some ways the only - source for documentation on the Nvidia hardware interface.

However, as others have already said, if there's any option of targeting either Intel or AMD instead of (or at least before) NVidia, that would be the better choice. Even if you would still want - or need - to implement Nvidia drivers at some point, getting the other two done first would at least give you the experience with GPU drivers so that you could focus more on the Nvidia-specific aspects once you have the more general aspects mastered.

Note that even for Linux, the Nvidia official drivers are closed source - they didn't provide anyone in the Linux community documentation, they just started handing out their own binary blob drivers when it became clear that they couldn't afford to ignore Linux outright (and many suspect that they only did that because they wanted to sell GPGPU hardware to supercomputer sites - providing drivers to ordinary Linux users was just a side result). The drivers are free, but the source code and hardware details are still kept under lock and key.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: Implementing graphics drivers..

Post by nullplan »

Schol-R-LEA wrote:Note that even for Linux, the Nvidia official drivers are closed source - they didn't provide anyone in the Linux community documentation, they just started handing out their own binary blob drivers when it became clear that they couldn't afford to ignore Linux outright (and many suspect that they only did that because they wanted to sell GPGPU hardware to supercomputer sites - providing drivers to ordinary Linux users was just a side result). The drivers are free, but the source code and hardware details are still kept under lock and key.
Yep. The way the binary nVidia driver works is this: There is a source code part and a binary part. The source code part adapts to the kernel version. The driver creates a new device which is mapped into memory, and the binary blob then interacts with the card through the memory mapping. This makes it hard to trace what is going on, although in theory you could use IOMMU to find out.
Carpe diem!
User avatar
pvc
Member
Member
Posts: 201
Joined: Mon Jan 15, 2018 2:27 pm

Re: Implementing graphics drivers..

Post by pvc »

As for NVIDIA, I was able to find this https://envytools.readthedocs.io/en/lat ... index.html piece of documentation some time ago. It's far from complete, but still, it should be better than nothing.
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: Implementing graphics drivers..

Post by eekee »

Uh... FreeBSD has Nvidia drivers and Nvidia techs are quite eager to support it. If Linux has 1% of the desktop market, FreeBSD must have less than 1% of 1%. I'd say go for it; approach Nvidia about a driver, but be very polite and try not to take up too much of their support time because you're not exactly making them any money to pay for that support time. You probably will have to sign a non-disclosure agreement.
Ethin wrote:The fact that Linux needed to make an open-source driver *before* NVIDIA gave us drivers for Linux, if memory serves, should tell you something.
No, it shouldn't tell us something; things were different in that era. Basically all corporate attitudes to open source were different. It was even illegal to mod games. When Nvidia first released drivers for Linux, things were beginning to change. IBM had famously embraced Linux, much to everyones surprise. Nvidia weren't the first hardware vendors to accept Linux, but they were quite early. Relatively few other hardware vendors had. ATi may have released more documentation, but it was poor documentation. ATi drivers for Linux were much poorer-quality than Nvidia's for many years. Intel, of course, were not remotely competitive in graphics performance for over a decade.

Linus Torvalds complained about the closed-source nature of Nvidia drivers more than once, but this was because he and other Linux kernel devs didn't have the right to use debuggers on it. They couldn't see if the Nvidia driver was causing problems. I'm sure it's different for kernel devs who have signed the NDA to allow them to look into the driver. As a user using Nvidia drivers with stable Linux kernel versions, I only once had a problem which may or may not have been Nvidia's fault. I had more problems with Intel drivers at a time when Intel were enthusiastic contributors to Linux!
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Post Reply