Skip to content

Commit bbcf66d

Browse files
authored
Merge pull request #45 from dasteihn/nova-docu-update
Nova docu update
2 parents 3b2001f + daf9c78 commit bbcf66d

File tree

2 files changed

+80
-35
lines changed

2 files changed

+80
-35
lines changed

src/Nova-GPU-Driver.md

Lines changed: 80 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,107 @@
11
# Nova GPU Driver
22

3-
Nova is a driver for GSP-based Nvidia GPUs that is currently under development
4-
and is being written in Rust.
3+
Nova is a driver for GSP (GPU system processor) based Nvidia GPUs. It is
4+
intended to become the successor of Nouveau as the mainline driver for Nvidia
5+
(GSP) GPUs in Linux.
56

6-
Currently, the objective is to upstream Rust abstractions for the relevant
7-
subsystems a prerequisite for the actual driver. Hence, the first mainline
8-
version of Nova will be a stub driver which helps establishing the necessary
9-
infrastructure in other subsystems (notably PCI and DRM).
7+
It will support all Nvidia GPUs beginning with the GeForce RTX20 (Turing family)
8+
series and newer.
109

1110
## Contact
1211

13-
To contact the team and / or participate in development, please use the mailing
14-
list: nouveau@lists.freedesktop.org
12+
Available communication channels are:
13+
14+
- The mailing list: nouveau@lists.freedesktop.org
15+
- IRC: #nouveau on OFTC
16+
- [Zulip Chat](https://rust-for-linux.zulipchat.com/#narrow/channel/509436-Nova)
1517

1618

1719
## Resources
1820

19-
- [Official Source Tree](https://gitlab.freedesktop.org/drm/nova)
20-
- [Announcement E-Mail](https://lore.kernel.org/dri-devel/Zfsj0_tb-0-tNrJy@cassiopeiae/)
21+
The parts that are already in mainline Linux can be found in
22+
`drivers/gpu/nova-core/` and `drivers/gpu/drm/nova/`
23+
24+
The development repository for the in-tree driver is located on
25+
[Freedesktop](https://gitlab.freedesktop.org/drm/nova).
26+
27+
28+
## Background
29+
30+
### Why a new driver?
31+
32+
Nouveau was, for the most part, designed for pre-GSP hardware. The driver exists
33+
since ~2009 and its authors back in the day had to reverse engineer a lot about
34+
the hardware's internals, resulting in a relatively difficult to maintain
35+
codebase.
36+
37+
Moreover, Nouveau's maintainers concluded that a new driver, exclusively for
38+
GSP hardware, would allow for significantly simplifying the driver design: Most
39+
of the hardware internals that Nouveau had to reverse engineer reside in the
40+
GSP firmware. Hereby, the GSP takes up the role of a hardware abstraction layer
41+
which communicates with the host kernel through IPC. Thereby, a lot of the
42+
stack's complexity is moved from the GPU driver into the GSP firmware.
43+
44+
This, in consequence, enables better maintainability. Another chance with a new
45+
driver is to obtain active community participation from the very beginning.
46+
47+
48+
### Why write it in Rust?
2149

22-
In the source tree, the driver lives in `drivers/gpu/drm/nova`.
50+
Besides Rust's built-in ownership and lifetime model, its powerful type system
51+
allows us to avoid a large portion of a whole class of bugs (i.e. memory safety
52+
bugs).
2353

54+
Additionally, the same features allow us to model APIs in a way that also
55+
certain logic errors can be caught at compile time already.
2456

25-
## Status
57+
Especially GPU drivers can benefit a lot from Rust's ownership and lifetime
58+
model, given their highly concurrent and asynchronous design.
2659

27-
Currently, Nova is just a stub driver intended to lift the bindings necessary
28-
for a real GPU driver into the (mainline) kernel.
60+
Since Nova is a new driver, written from scratch, it is an opportunity to try to
61+
leverage the advantages of Rust and obtain a more reliable, maintainable driver.
2962

30-
Currently, those efforts are mostly focused on getting bindings for PCI, DRM
31-
and the Device (driver) model upstream.
3263

33-
It can be expected that, as the driver continues to grow, various other abstractions
34-
will be needed.
64+
## Architecture
3565

66+
![Nova Architecture with vGPUs](./nova-core-vm.png)
3667

37-
## Utilized Common Rust Infrastructure
68+
The overall GPU driver is split into two parts:
3869

39-
Nova depends on the Rust for Linux `staging/*` [branches](Branches.md).
70+
1. "Nova-Core", living in `drivers/gpu/nova-core/`. Nova-Core implements
71+
the fundamental interaction with the hardware (through PCI etc.) and,
72+
notably, boots up the GSP and interacts with it through a command queue.
73+
2. "Nova-DRM" (the official name is actually just "Nova", but to avoid
74+
confusion developers usually call it "Nova-DRM"), living in
75+
`drivers/gpu/drm/nova/`. This is the actual graphics driver,
76+
implementing all the typical DRM interfaces for userspace.
4077

78+
This split architecture allows for different drivers building on top of the
79+
abstraction layer provided by Nova-Core. Besides Nova-DRM, for instance, a VFIO
80+
driver to virtualize the GPU can be built on top of Nova-Core. Through this
81+
driver Nova-Core can be used to instruct the GPU's firmware to spawn new PCI
82+
virtual functions (through
83+
[SR-IOV](https://docs.kernel.org/PCI/pci-iov-howto.html)), representing virtual
84+
GPUs. Those virtual functions (or vGPUs) can be used by virtual machines. Such
85+
a virtual machine running Linux may run Nova-Core and Nova-DRM as conventional
86+
GPU drivers on top of this vGPU.
4187

42-
## Contributing
88+
A main advantage of this design is that the amount of software running on the
89+
host (where crashes would be far more fatal than inside of a VM) is kept small,
90+
which contributes to stability.
4391

44-
As with every real open source program, help and participation is highly welcome!
92+
It is also possible to use Nova-Core + Nova-DRM on one physical machine (not
93+
depicted in the diagram) in order to expose a DRM compatible uAPI to the host
94+
userspace.
4595

46-
As the driver is very young, however, it is currently difficult to assign tasks
47-
to people. Many things still have to settle until a steadily paced workflow
48-
produces atomic work topics a new one can work on.
96+
For more details about vGPUs, take a look at
97+
[Zhi's announcement email](https://lore.kernel.org/nouveau/20240922124951.1946072-1-zhiw@nvidia.com/).
4998

50-
If you really want to jump in immediately regardless, here are a few things you
51-
can consider:
5299

53-
- Most work to do right now is with more bindings for Rust. Notably, this
54-
includes the device driver model, DRM and PCI. If you have expertise there,
55-
have a look at the existing code in the [topic branches](Branches.md) and see
56-
if there's something you can add or improve.
57-
- Feel free to go over Nova's code base and make suggestions or send patches,
58-
for example for improved comments, grammar fixes, improving code readability
59-
etc.
100+
## Status and Contributing
60101

102+
The necessary Rust infrastructure has been progressing a lot. Current work now
103+
focuses more on the actual driver. In case you want to contribute, take a look
104+
at the
105+
[NOVA TODO List](https://docs.kernel.org/gpu/nova/core/todo.html).
61106

62-
Happy hacking!
107+
Don't hesitate reaching out on the aforementioned community channels.

src/nova-core-vm.png

50 KB
Loading

0 commit comments

Comments
 (0)