Find a file
Artturin bed5c381d7 hugepages 4
tt-system-tools script says wh should use 4
2024-10-14 04:09:28 +03:00
pkgs system-tools: init 2024-10-14 03:08:50 +03:00
tests Add test 2024-10-01 22:46:35 +03:00
.gitignore Add gitignore 2024-10-02 00:11:37 +03:00
default.nix Add flake-compat files 2024-10-01 23:57:22 +03:00
flake.lock Add flake-compat files 2024-10-01 23:57:22 +03:00
flake.nix hugepages 4 2024-10-14 04:09:28 +03:00
README.md Update readme 2024-10-14 03:10:23 +03:00
shell.nix Add flake-compat files 2024-10-01 23:57:22 +03: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 = {
  url = "github:Artturin/tt-flake";
  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.

nix run github:Artturin/tt-flake#kmd-test

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.