-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This driver enables the use of Coral.ai's PCIe TPU modules. Signed-off-by: Branden Cash <[email protected]> Signed-off-by: Noel Georgi <[email protected]>
- Loading branch information
Showing
7 changed files
with
114 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# gasket-driver extension | ||
|
||
## Installation | ||
|
||
Add the extension to your machine config and enable the modules: | ||
|
||
```yaml | ||
machine: | ||
install: | ||
extensions: | ||
- image: ghcr.io/siderolabs/gasket-driver:<VERSION> | ||
kernel: | ||
modules: | ||
- name: gasket | ||
- name: apex | ||
``` | ||
By default, the device will be owned by UID and GID `0` and is only accessible by root. | ||
If you need to change this, you may do this by adding udev rules to your machine configuration like this, | ||
which would change the GID to `44` and give that group read/write permissions. | ||
|
||
```yaml | ||
machine: | ||
udev: | ||
rules: | ||
- SUBSYSTEM=="apex", MODE="0660", GROUP="44" | ||
``` | ||
|
||
## Verifiying | ||
|
||
You can verify the modules are enabled by reading the `/proc/modules` where it _should_ show the module is live. | ||
|
||
For example: | ||
|
||
``` | ||
❯ talosctl -n 192.168.32.5 read /proc/modules | ||
apex 20480 - - Live 0xffffffffc01c9000 (O) | ||
gasket 94208 - - Live 0xffffffffc01aa000 (O) | ||
``` | ||
|
||
In addition, if you actually have Coral module installed, you should be able to verify it's presence at `/dev/apex_0`. | ||
|
||
For example: | ||
|
||
``` | ||
❯ talosctl -n 192.168.32.5 ls -l /dev/apex_0 | ||
NODE MODE UID GID SIZE(B) LASTMOD NAME | ||
192.168.32.5 Dcrw-rw---- 0 44 0 Sep 10 18:15:52 apex_0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: v1alpha1 | ||
metadata: | ||
name: gasket | ||
version: "$VERSION" | ||
author: Sidero Labs | ||
description: | | ||
This system extension provides google gasket driver kernel modules built against a specific Talos version. | ||
This driver is required for PCIe and M.2 Google Coral accelerators. There are 2 kernel modules ("gasket" | ||
and "apex") required to enable this driver. | ||
compatibility: | ||
talos: | ||
version: ">= v1.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: gasket-driver | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
# The pkgs version for a particular release of Talos as defined in | ||
# https://github.com/siderolabs/talos/blob/<talos version>/pkg/machinery/gendata/data/pkgs | ||
- image: "{{ .PKGS_PREFIX }}/gasket-driver-pkg:{{ .PKGS_VERSION }}" | ||
steps: | ||
- prepare: | ||
- | | ||
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml | ||
- install: | ||
- | | ||
mkdir -p /rootfs/lib/modules | ||
cp -R /lib/modules/* /rootfs/lib/modules | ||
finalize: | ||
- from: /rootfs | ||
to: /rootfs | ||
- from: /pkg/manifest.yaml | ||
to: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# update when pkgs version is updated | ||
VERSION: "97aeba58-{{ .BUILD_ARG_TAG }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters