Writing GPU drivers
Writing GPU drivers
Hi,
for a parallel computing project I need to use GPUs. The "OS" where I am going to use the GPU has nothing , it is an exokernel OS, with about 10% of glibc functions. So, OpenCL and "user installable drivers" from the manufacturer wont work. To make it shorter, my question is this: which GPU manufacturer would you go for, to write your own driver? (just one GPU model support will be enough) Besides NVIDIA, Intel, and AMD there are some few GPU manufactuers out there, but who of those manufacturers have the most open source friendly technology? I need it to be open source, so I can port the driver to my OS and use the GPU. And I do not want to suffer like the Nouveau folks reverse engineering the GPU-CPU communication traffic.
Will appreciate very much your comments.
TIA
Nulik
for a parallel computing project I need to use GPUs. The "OS" where I am going to use the GPU has nothing , it is an exokernel OS, with about 10% of glibc functions. So, OpenCL and "user installable drivers" from the manufacturer wont work. To make it shorter, my question is this: which GPU manufacturer would you go for, to write your own driver? (just one GPU model support will be enough) Besides NVIDIA, Intel, and AMD there are some few GPU manufactuers out there, but who of those manufacturers have the most open source friendly technology? I need it to be open source, so I can port the driver to my OS and use the GPU. And I do not want to suffer like the Nouveau folks reverse engineering the GPU-CPU communication traffic.
Will appreciate very much your comments.
TIA
Nulik
Re: Writing GPU drivers
Hi,
Run now.
Run fast. Don't look back.
Don't stop running until the project's deadline has passed. Only then should you look back at the carnage the project's failure caused and marvel at the sheer horror.
Cheers,
Brendan
Run.nulik wrote:for a parallel computing project I need to use GPUs. The "OS" where I am going to use the GPU has nothing , it is an exokernel OS, with about 10% of glibc functions. So, OpenCL and "user installable drivers" from the manufacturer wont work. To make it shorter, my question is this: which GPU manufacturer would you go for, to write your own driver? (just one GPU model support will be enough) Besides NVIDIA, Intel, and AMD there are some few GPU manufactuers out there, but who of those manufacturers have the most open source friendly technology? I need it to be open source, so I can port the driver to my OS and use the GPU. And I do not want to suffer like the Nouveau folks reverse engineering the GPU-CPU communication traffic.
Run now.
Run fast. Don't look back.
Don't stop running until the project's deadline has passed. Only then should you look back at the carnage the project's failure caused and marvel at the sheer horror.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Writing GPU drivers
Well that was incredibly helpful! Good job representing OSDev.org, Brendan!
Intel is probably the most openly documented of the three, but also the least powerful. AMD is documented to some degree and has open source drivers for Linux, but as far as I know those drivers aren't as capable as the closed-source ones. Nvidia, as you noted, is (almost) completely undocumented.
The only other GPUs I know of that are still in use today are for mobile devices, and those aren't very open- PowerVR, Qualcomm, etc. However, Broadcom recently released the source and specification for their GPU used in the Raspberry Pi- but that's probably around the same level as an Intel GPU.
Is there any reason you have to use that particular OS for this project? What kind of schedule/funding do you have?
Intel is probably the most openly documented of the three, but also the least powerful. AMD is documented to some degree and has open source drivers for Linux, but as far as I know those drivers aren't as capable as the closed-source ones. Nvidia, as you noted, is (almost) completely undocumented.
The only other GPUs I know of that are still in use today are for mobile devices, and those aren't very open- PowerVR, Qualcomm, etc. However, Broadcom recently released the source and specification for their GPU used in the Raspberry Pi- but that's probably around the same level as an Intel GPU.
Is there any reason you have to use that particular OS for this project? What kind of schedule/funding do you have?
Re: Writing GPU drivers
it's too hard. There is no compatibility between the cards even one manufacturer. I made a video mode switching and hardware cursor through the registers for the R600-R700. Initialize AMD GPU is too difficult. Almost all documents closed. Intel GPU is much easier + open documentation. Initialize GPU + GART is about 10k С code lines (min) for new AMD GPU. About nVidia I do not know anything. I do not think that it is easier.
Re: Writing GPU drivers
Thanks! This input is very helpful. I actually don't need a lot of power, just the average. The Intel GPU will work. What models of Intel GPUs are you talking about? Is there any sample code I can see? I hope it is not the Xeon Phi, since it is very expensive.shmx wrote:it's too hard. There is no compatibility between the cards even one manufacturer. I made a video mode switching and hardware cursor through the registers for the R600-R700. Initialize AMD GPU is too difficult. Almost all documents closed. Intel GPU is much easier + open documentation. Initialize GPU + GART is about 10k С code lines (min) for new AMD GPU. About nVidia I do not know anything. I do not think that it is easier.
Re: Writing GPU drivers
what they are talking about is the integrated graphics that is built into almost every single Intel CPU sold in the last 6 years -- basically, if your computer has an Intel CPU, it probably also has an Intel GPU -- only exceptions are the workstation chips (xeon), some low-end chips (mostly older atom use a different graphics system, but also certain models of pentium/celron) and the E series chipsnulik wrote: Thanks! This input is very helpful. I actually don't need a lot of power, just the average. The Intel GPU will work. What models of Intel GPUs are you talking about? Is there any sample code I can see? I hope it is not the Xeon Phi, since it is very expensive.
all the documentation for them has been moved to https://01.org/linuxgraphics/documentat ... ation-prms
Re: Writing GPU drivers
I've only worked with the old 945 chips. New chips (integrated in CPU) is not much more complicated.nulik wrote:What models of Intel GPUs are you talking about?
There are only fragments of source code for attempts (half successful ) organization 2D acceleration. You can view the source code KolibriOS. They are much more advanced in this.nulik wrote:Is there any sample code I can see?
Re: Writing GPU drivers
All documentation on Intel GPU can be found in Google.
Re: Writing GPU drivers
Thanks! Looks like neither today I am going to sleep, very exciting stuff!JAAman wrote:
all the documentation for them has been moved to https://01.org/linuxgraphics/documentat ... ation-prms
Re: Writing GPU drivers
I'm not sure what your actual restrictions are, but you may want to consider using VMWare to run your OS, as its 3D accelerated functionality is fairly simple and well documented with examples and source code.
VirtualBox is also an option, although I think VMWare has better documentation, and possibly more features.
If you must run on an actual machine, Intel is probably the way to go.
VirtualBox is also an option, although I think VMWare has better documentation, and possibly more features.
If you must run on an actual machine, Intel is probably the way to go.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Re: Writing GPU drivers
Another (likely relatively minor) consideration is that AMD cards are pretty straightforward to pass through to KVM/Xen virtual machines, Nvidia is possible but harder, and Intel is not possible yet but work is being done to let multiple VMs (including dom0) share a single Intel GPU without going through something like VMWare's graphics acceleration interface.
Re: Writing GPU drivers
Hi,
Cheers,
Brendan
VM interfaces typically convert the guests graphics into the host's OpenGL/DirectX API, which is fine for 3D graphics but isn't usable for GPGPU.SpyderTL wrote:I'm not sure what your actual restrictions are, but you may want to consider using VMWare to run your OS, as its 3D accelerated functionality is fairly simple and well documented with examples and source code.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Writing GPU drivers
OpenGL and DirectX both support compute shaders, so it should be possible in principle. I can't tell at a glance whether VMWare or VirtualBox can handle them though.
Re: Writing GPU drivers
Hi,
Cheers,
Brendan
It really doesn't take much searching to find out they can't (unless you're using some form of "PCI pass through" to give the guest direct access to the real GPU).Rusky wrote:OpenGL and DirectX both support compute shaders, so it should be possible in principle. I can't tell at a glance whether VMWare or VirtualBox can handle them though.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Writing GPU drivers
Are you saying they can't, or don't? Because I don't believe either is entirely true- I've seen fairly recent games run (very slowly) in VMWare and VirtualBox, and those games tend to use compute shaders.