Nvidia QUADRO 2000 Driver
Nvidia QUADRO 2000 Driver
I Want to write a simple display adapter for my gpu, maybe add some 3d support to gain some knowledge.
Should I use the nouveau project as a reference ? My only problem is that these linux sources are very complicated. And it is so hard to understand the code.
To make sure it is supported, I tried the ChromeOS Flex on my PC (Not installed) and it immediately sets the screen resolution.
Should I use the nouveau project as a reference ? My only problem is that these linux sources are very complicated. And it is so hard to understand the code.
To make sure it is supported, I tried the ChromeOS Flex on my PC (Not installed) and it immediately sets the screen resolution.
Re: Nvidia QUADRO 2000 Driver
OK, get a framebuffer going, maybe some 2D acceleration with a hardware mouse cursor, that should be feasible to reverse engineer from the VESA code.devc1 wrote:I Want to write a simple display adapter for my gpu
Well, that is going to be quite the leap from what I outlined above.devc1 wrote:maybe add some 3d support to gain some knowledge.
Anything that helps you. But nouveau is itself the result of a reverse engineering effort. If I was you, I would dump and disassemble the VBIOS. VESA code must exist to query supported video modes and set them, so that ought to tell you how to do it on your card. Just trace out the interrupt 10h handler for the various well-known functions. Alternatively you could try looking for documentation for your card, but I don't know how successful that will be. Nvidia is famously tight-lipped about these things.devc1 wrote:Should I use the nouveau project as a reference ?
Carpe diem!
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Nvidia QUADRO 2000 Driver
Not as much as they used to be! Unfortunately, the currently available documentation doesn't cover Fermi GPUs like the Quadro 2000 very well, so some reverse-engineering will likely be involved. (But it does cover some parts, like the bytecode interpreter in the VBE ROM, so definitely look at that before you start disassembling it.)nullplan wrote:Nvidia is famously tight-lipped about these things.
Re: Nvidia QUADRO 2000 Driver
The ROM might not be that helpful, especially if you want acceleration. Better to disassemble the Windows drivers, starting with the video miniport driver and then moving on to the GDI and DirectDraw drivers.
Re: Nvidia QUADRO 2000 Driver
One can try an old AMD GPU built on GCN 1.0+ uArch. Some of those old GPUs can be bought for cheap prices (depending upon your region).
The Linux drivers (radeon or amdgpu) can help setup the device (POSTing the bios, loading the uCode, filling the registers, setting up the GART, setting up the location and layout of framebuffers, configuring the clocks and the display pipeline, etc.)
Mesa contains OpenGL and Vulkan drivers for (supported) GPUs; that will help set up the command streams to draw 3D, etc. One can recompile Mesa and DRM with debug symbols, point the triangle or game or whichever OpenGL/Vulkan application to those recompiled libraries, and live-debug using gdb, to see how the command streams are set up.
Mesa also has built-in debug variables that can help in dumping the intermediate representations and the final hw-level assembly of the shaders, all without recompiling Mesa.
The GPU ISA is public, so one can even write one's own assembler to assemble the shader code.
One can also go a bit further back in time and run with TeraScale GPUs. Their ISAs aren't very straightforward, as they were VLIW5- or VLIW4- based ISAs.
Such a GPU can be inserted into the host system, and can be made to pass through to a VM, so that you can test your driver with relative ease. You also do not need to buy a separate monitor - a cheap HDMI-to-USB video capture device, along with software like OBS Studio will do.
AMD releases its GPU drivers under the MIT license, so there is some amount of wiggle room for someone learning to write such drivers.
The advantages listed above may also apply to Intel GPUs, since they too provide extensive documentation, plus their kernel-mode and user-mode GPU drivers are open-source.
If you are not restricted to x86-based OS, you can also try to learn programming the RPi VideoCore IV GPU, or one of the Arm Mali GPUs. Linux and Mesa can help even in these cases. Moreover, these GPUs are simpler to program than the desktop GPUs.
IMHO, understanding AMD's kernel driver is much easier than understanding Nouveau. Nouveau is very generously sprinkled with magic numbers which initially put me off and had me looking elsewhere, though I believe that, once armed with the experience of programming a GPU, nouveau too shouldn't pose too much of a challenge.
Another aspect of NVIDIA GPUs that disappoint me is the lack of documentation on their ISA - they instead ask for the shader code to be presented in their PTX byte code format (which I believe is indeed open), and then rely on their closed-source driver for the translation from PTX to hw-level binary. Nouveau/Mesa may or may not have reached a point where they have the actual hw-level ISA reversed for us to use, for a particular NVIDIA GPU.
The Linux drivers (radeon or amdgpu) can help setup the device (POSTing the bios, loading the uCode, filling the registers, setting up the GART, setting up the location and layout of framebuffers, configuring the clocks and the display pipeline, etc.)
Mesa contains OpenGL and Vulkan drivers for (supported) GPUs; that will help set up the command streams to draw 3D, etc. One can recompile Mesa and DRM with debug symbols, point the triangle or game or whichever OpenGL/Vulkan application to those recompiled libraries, and live-debug using gdb, to see how the command streams are set up.
Mesa also has built-in debug variables that can help in dumping the intermediate representations and the final hw-level assembly of the shaders, all without recompiling Mesa.
The GPU ISA is public, so one can even write one's own assembler to assemble the shader code.
One can also go a bit further back in time and run with TeraScale GPUs. Their ISAs aren't very straightforward, as they were VLIW5- or VLIW4- based ISAs.
Such a GPU can be inserted into the host system, and can be made to pass through to a VM, so that you can test your driver with relative ease. You also do not need to buy a separate monitor - a cheap HDMI-to-USB video capture device, along with software like OBS Studio will do.
AMD releases its GPU drivers under the MIT license, so there is some amount of wiggle room for someone learning to write such drivers.
The advantages listed above may also apply to Intel GPUs, since they too provide extensive documentation, plus their kernel-mode and user-mode GPU drivers are open-source.
If you are not restricted to x86-based OS, you can also try to learn programming the RPi VideoCore IV GPU, or one of the Arm Mali GPUs. Linux and Mesa can help even in these cases. Moreover, these GPUs are simpler to program than the desktop GPUs.
IMHO, understanding AMD's kernel driver is much easier than understanding Nouveau. Nouveau is very generously sprinkled with magic numbers which initially put me off and had me looking elsewhere, though I believe that, once armed with the experience of programming a GPU, nouveau too shouldn't pose too much of a challenge.
Another aspect of NVIDIA GPUs that disappoint me is the lack of documentation on their ISA - they instead ask for the shader code to be presented in their PTX byte code format (which I believe is indeed open), and then rely on their closed-source driver for the translation from PTX to hw-level binary. Nouveau/Mesa may or may not have reached a point where they have the actual hw-level ISA reversed for us to use, for a particular NVIDIA GPU.
Re: Nvidia QUADRO 2000 Driver
Dunno about the AMD GPU documentation (I can't seem to find it, just ISA documentation), but the Intel ones are ridiculously convoluted in terms of "where do I find what?". For me, at least, its non-intuitive where to get started and then where to go from there.
Re: Nvidia QUADRO 2000 Driver
But if my gpu isn't included in the nouveau project, how does ChromeOS sets the resolution immediatly at startup ?
Re: Nvidia QUADRO 2000 Driver
VESA? Or maybe ChromeOS comes with a better driver.devc1 wrote:But if my gpu isn't included in the nouveau project, how does ChromeOS sets the resolution immediatly at startup ?
Carpe diem!
Re: Nvidia QUADRO 2000 Driver
First chrome os is booting into UEFI.
Second, GOP in my PC (because my os also boots in uefi) does not include a high resolution such as 1920x1080.
And graphics seem to be accelerated with less cpu usage.
I've gone through some documentation from the nouveau project and they state that they have some documentations about nvidia fermi gpus like mine (quadro 2000).
But the documentation does not include anything about the architecture, it is just like an introduction
Second, GOP in my PC (because my os also boots in uefi) does not include a high resolution such as 1920x1080.
And graphics seem to be accelerated with less cpu usage.
I've gone through some documentation from the nouveau project and they state that they have some documentations about nvidia fermi gpus like mine (quadro 2000).
But the documentation does not include anything about the architecture, it is just like an introduction
Re: Nvidia QUADRO 2000 Driver
Sorry but I feel that most topics that I open have no answers or need some guy like Linus torvalds to call some company to give us the answer : (
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Nvidia QUADRO 2000 Driver
It is included. Fermi is the NVC0 column.devc1 wrote:But if my gpu isn't included in the nouveau project,
For a lot of things, the nouveau source code is the only documentation.devc1 wrote:But the documentation does not include anything about the architecture, it is just like an introduction
Re: Nvidia QUADRO 2000 Driver
Where is the driver entry point ? Is it "nouveau_drm_init" ?
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm