Nvidia QUADRO 2000 Driver

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
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Nvidia QUADRO 2000 Driver

Post by devc1 »

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.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: Nvidia QUADRO 2000 Driver

Post by nullplan »

devc1 wrote:I Want to write a simple display adapter for my gpu
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:maybe add some 3d support to gain some knowledge.
Well, that is going to be quite the leap from what I outlined above.
devc1 wrote:Should I use the nouveau project as a reference ?
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.
Carpe diem!
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Nvidia QUADRO 2000 Driver

Post by Octocontrabass »

nullplan wrote:Nvidia is famously tight-lipped about these things.
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.)
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Nvidia QUADRO 2000 Driver

Post by Gigasoft »

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.
linuxyne
Member
Member
Posts: 211
Joined: Sat Jul 02, 2016 7:02 am

Re: Nvidia QUADRO 2000 Driver

Post by linuxyne »

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.
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: Nvidia QUADRO 2000 Driver

Post by Ethin »

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.
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Re: Nvidia QUADRO 2000 Driver

Post by devc1 »

But if my gpu isn't included in the nouveau project, how does ChromeOS sets the resolution immediatly at startup ?
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: Nvidia QUADRO 2000 Driver

Post by nullplan »

devc1 wrote:But if my gpu isn't included in the nouveau project, how does ChromeOS sets the resolution immediatly at startup ?
VESA? Or maybe ChromeOS comes with a better driver.
Carpe diem!
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Re: Nvidia QUADRO 2000 Driver

Post by devc1 »

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
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Re: Nvidia QUADRO 2000 Driver

Post by devc1 »

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 : (
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Nvidia QUADRO 2000 Driver

Post by Octocontrabass »

devc1 wrote:But if my gpu isn't included in the nouveau project,
It is included. Fermi is the NVC0 column.
devc1 wrote:But the documentation does not include anything about the architecture, it is just like an introduction
For a lot of things, the nouveau source code is the only documentation.
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Re: Nvidia QUADRO 2000 Driver

Post by devc1 »

Where is the driver entry point ? Is it "nouveau_drm_init" ?
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Nvidia QUADRO 2000 Driver

Post by Octocontrabass »

Post Reply