tt-flake/README.md

65 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2024-01-31 05:20:40 +00:00
# Tenstorrent Software (unofficial, WIP)
## Installing kmod
Add this flake to your configuration flake's inputs and pin its `nixpkgs` to your version.
```
tt-flake = {
2024-10-14 00:10:18 +00:00
url = "github:Artturin/tt-flake";
2024-01-31 05:20:40 +00:00
inputs.nixpkgs.follows = "nixpkgs";
};
```
Enable hugepages and IOMMU passthrough. One 1G page is needed per Grayskull, and two for each Wormhole. Add the kernel module to your configuration.
`flake.nix`:
```
hostname = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
...
(import ./machines/hostname/configuration.nix)
# perhaps this module could be shipped by the flake in the future
({ pkgs, ... }: {
boot.extraModulePackages = [ tt-flake.packages.x86_64-linux.kmd ];
boot.kernelParams = [ "hugepagesz=1G" "hugepages=2" "iommu=pt" ];
boot.kernelModules = [ "tenstorrent" ];
services.udev.packages = [ tt-flake.packages.x86_64-linux.udev-rules ];
})
...
```
Reboot and run the tests. Some of the tests may require root.
```
2024-10-14 00:10:18 +00:00
nix run github:Artturin/tt-flake#kmd-test
2024-01-31 05:20:40 +00:00
```
2024-10-14 01:15:13 +00:00
If you get `AER is disabled.` add `--skip-aer`.
2024-01-31 05:20:40 +00:00
You should see testing output on stdout, and some errors (with a possible stack trace) in dmesg.
`stdout`:
```
Testing /dev/tenstorrent/0 @ 0000:a8:00.0
Testing /dev/tenstorrent/1 @ 0000:76:00.0
```
`dmesg`:
```
[ 173.045092] tenstorrent: pin_user_pages_longterm failed: -14
[ 173.046086] tenstorrent: could only pin 1 of 2 pages
```
As far as I can tell, these failures are exercised by the tests, and a clean `stdout` means there is no issue.
2025-01-29 01:53:16 +00:00
# TODO
- [ ] Better update system