Compare commits
16 commits
ttmetalful
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
65d7bef16d | ||
![]() |
2245c9c5ea | ||
![]() |
f18aa5fee2 | ||
![]() |
31f0cee50d | ||
![]() |
ba96c32479 | ||
![]() |
24410845a0 | ||
![]() |
8412c8bf22 | ||
![]() |
c1b3fac31c | ||
![]() |
fa8e1be058 | ||
![]() |
9abd0fb916 | ||
![]() |
8f850c7c62 | ||
![]() |
66bf540c3e | ||
![]() |
e5c7215b90 | ||
![]() |
441f4dc464 | ||
![]() |
1ae7313fad | ||
![]() |
be924e4600 |
|
@ -57,3 +57,8 @@ Testing /dev/tenstorrent/1 @ 0000:76:00.0
|
||||||
```
|
```
|
||||||
|
|
||||||
As far as I can tell, these failures are exercised by the tests, and a clean `stdout` means there is no issue.
|
As far as I can tell, these failures are exercised by the tests, and a clean `stdout` means there is no issue.
|
||||||
|
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
|
||||||
|
- [ ] Better update system
|
||||||
|
|
18
flake.lock
18
flake.lock
|
@ -3,11 +3,11 @@
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696426674,
|
"lastModified": 1733328505,
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -18,11 +18,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1727634051,
|
"lastModified": 1734649271,
|
||||||
"narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=",
|
"narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9",
|
"rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -59,11 +59,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726560853,
|
"lastModified": 1731533236,
|
||||||
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
56
flake.nix
56
flake.nix
|
@ -31,15 +31,12 @@
|
||||||
{
|
{
|
||||||
kmd = callPackages ./pkgs/kmd { inherit kernel; };
|
kmd = callPackages ./pkgs/kmd { inherit kernel; };
|
||||||
sfpi = callPackages ./pkgs/sfpi { };
|
sfpi = callPackages ./pkgs/sfpi { };
|
||||||
luwen = callPackage ./pkgs/luwen { };
|
luwen = (callPackage ./pkgs/luwen { }).luwen;
|
||||||
|
pyluwen = (callPackage ./pkgs/luwen { }).pyluwen;
|
||||||
tools-common = callPackage ./pkgs/tools-common { };
|
tools-common = callPackage ./pkgs/tools-common { };
|
||||||
system-tools = callPackage ./pkgs/system-tools { };
|
system-tools = callPackage ./pkgs/system-tools { };
|
||||||
flash = callPackage ./pkgs/flash {
|
flash = callPackage ./pkgs/flash { };
|
||||||
pyluwen = self.luwen.pyluwen_0_1;
|
smi = callPackage ./pkgs/smi { };
|
||||||
};
|
|
||||||
smi = callPackage ./pkgs/smi {
|
|
||||||
pyluwen = self.luwen.pyluwen;
|
|
||||||
};
|
|
||||||
umd = callPackage ./pkgs/umd { };
|
umd = callPackage ./pkgs/umd { };
|
||||||
metal = callPackage ./pkgs/metal { };
|
metal = callPackage ./pkgs/metal { };
|
||||||
|
|
||||||
|
@ -52,10 +49,11 @@
|
||||||
udev-rules = scope.kmd.udev-rules;
|
udev-rules = scope.kmd.udev-rules;
|
||||||
kmd-test = scope.kmd.test;
|
kmd-test = scope.kmd.test;
|
||||||
sfpi = scope.sfpi.sfpi;
|
sfpi = scope.sfpi.sfpi;
|
||||||
|
sfpi-prebuilt = scope.sfpi.prebuilt;
|
||||||
tt-gcc = scope.sfpi.tt-gcc;
|
tt-gcc = scope.sfpi.tt-gcc;
|
||||||
smi = scope.smi;
|
smi = scope.smi;
|
||||||
luwen = scope.luwen.luwen;
|
luwen = scope.luwen;
|
||||||
pyluwen = scope.luwen.pyluwen;
|
pyluwen = scope.pyluwen;
|
||||||
tools-common = scope.tools-common;
|
tools-common = scope.tools-common;
|
||||||
system-tools = scope.system-tools;
|
system-tools = scope.system-tools;
|
||||||
flash = scope.flash;
|
flash = scope.flash;
|
||||||
|
@ -94,17 +92,45 @@
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
kernelParams = [
|
kernelParams = [
|
||||||
# TODO: Use the scripts instead https://github.com/tenstorrent/tt-system-tools they work regardless of how many devices there are
|
|
||||||
# https://github.com/tenstorrent/tt-system-tools/blob/main/hugepages-setup.sh#L31
|
|
||||||
"hugepagesz=1G"
|
|
||||||
"hugepages=4"
|
|
||||||
"iommu=pt"
|
"iommu=pt"
|
||||||
];
|
];
|
||||||
kernelModules = [ "tenstorrent" ];
|
kernelModules = [ "tenstorrent" ];
|
||||||
};
|
};
|
||||||
services.udev.packages = [
|
systemd = {
|
||||||
(pkgs.tt-udev-rules or self.packages.${pkgs.hostPlatform.system}.udev-rules)
|
# https://github.com/NixOS/nixpkgs/issues/81138
|
||||||
|
services.tenstorrent-hugepages.wantedBy = [ "sysinit.target" ];
|
||||||
|
# Define https://github.com/tenstorrent/tt-system-tools/blob/29ba4dc6049eef3cee4314c53720417823ffc667/dev-hugepages%5Cx2d1G.mount
|
||||||
|
# because it has bad start ordering relations with tenstorrent-hugepages.service
|
||||||
|
# or it may be that the `wantedBy` does not work correctly in mounts like it does't work in serices.
|
||||||
|
mounts = [
|
||||||
|
{
|
||||||
|
description = "Mount hugepages at /dev/hugepages-1G for Tenstorrent ASICs";
|
||||||
|
what = "hugetlbfs";
|
||||||
|
where = "/dev/hugepages-1G";
|
||||||
|
type = "hugetlbfs";
|
||||||
|
options = "pagesize=1G,mode=0777,nosuid,nodev";
|
||||||
|
wantedBy = [ "sysinit.target" ];
|
||||||
|
after = [ "tenstorrent-hugepages.service" ];
|
||||||
|
unitConfig = {
|
||||||
|
DefaultDependencies = false;
|
||||||
|
ConditionPathExists = "/sys/kernel/mm/hugepages/hugepages-1048576kB";
|
||||||
|
ConditionCapability = "CAP_SYS_ADMIN";
|
||||||
|
};
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
packages = [
|
||||||
|
(pkgs.tt-system-tools or self.packages.${pkgs.hostPlatform.system}.system-tools)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
services.udev = {
|
||||||
|
packages = [ (pkgs.tt-udev-rules or self.packages.${pkgs.hostPlatform.system}.udev-rules) ];
|
||||||
|
# NOTE: passing just the group does not work currently for docker so unneeded for now so use the udev-rules package for now
|
||||||
|
# TT_METAL_HOME=$PWD docker run -v $PWD:/host --workdir /host -v /dev/hugepages-1G:/dev/hugepages-1G -v /dev/tenstorrent:/dev/tenstorrent -u :994 -v /etc/group:/etc/group:ro -it tt-metal bash
|
||||||
|
# extraRules = ''
|
||||||
|
# KERNEL=="tenstorrent*", MODE="0666", OWNER="root", GROUP="tenstorrent"
|
||||||
|
# '';
|
||||||
|
};
|
||||||
|
# users.groups.tenstorrent = { };
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,13 +8,13 @@ with pkgs.python3Packages;
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "tt-flash";
|
pname = "tt-flash";
|
||||||
version = "unstable-2024-09-27";
|
version = "3.1.1";
|
||||||
|
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "tenstorrent";
|
owner = "tenstorrent";
|
||||||
repo = "tt-flash";
|
repo = "tt-flash";
|
||||||
rev = "4002fee1da7edfcbf09093ba23612caeca071f23";
|
rev = "refs/tags/v${version}";
|
||||||
hash = "sha256-O6b/vS/zCjp/mrNzFEylWs0jtwdHY65nwkvn5GFridI=";
|
hash = "sha256-t2B1XEOKBKxE2eQiS7pc+EemBWomMgocyk4oRDt0Q78=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
||||||
|
|
|
@ -4,10 +4,10 @@ let
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "tenstorrent";
|
owner = "tenstorrent";
|
||||||
repo = "tt-kmd";
|
repo = "tt-kmd";
|
||||||
rev = "715a5d76e5dbb6d8972d4aa92e8cbe3434986b9f";
|
rev = "refs/tags/ttkmd-${version}";
|
||||||
hash = "sha256-OCnGhvIDIqkQJXlIpOVnP0O9cA9J7/bz1JPAOpeDNYQ=";
|
hash = "sha256-TTd+SXUQ/RwsZB7YIc0QsE9zHBCYO3NRrCub7/K1rP4=";
|
||||||
};
|
};
|
||||||
version = "unstable-2024-09-06";
|
version = "1.31";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
kmd = pkgs.stdenv.mkDerivation {
|
kmd = pkgs.stdenv.mkDerivation {
|
||||||
|
@ -41,6 +41,9 @@ in
|
||||||
test = pkgs.stdenv.mkDerivation {
|
test = pkgs.stdenv.mkDerivation {
|
||||||
pname = "tt-kmd-test";
|
pname = "tt-kmd-test";
|
||||||
|
|
||||||
|
# https://github.com/tenstorrent/tt-kmd/pull/37
|
||||||
|
patches = ./limits.patch;
|
||||||
|
|
||||||
inherit src version;
|
inherit src version;
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.gnumake ];
|
nativeBuildInputs = [ pkgs.gnumake ];
|
||||||
|
|
12
pkgs/kmd/limits.patch
Normal file
12
pkgs/kmd/limits.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
diff --git a/test/query_mappings.cpp b/test/query_mappings.cpp
|
||||||
|
index 0721485..7fe7ae4 100644
|
||||||
|
--- a/test/query_mappings.cpp
|
||||||
|
+++ b/test/query_mappings.cpp
|
||||||
|
@@ -16,6 +16,7 @@
|
||||||
|
#include <set>
|
||||||
|
#include <string>
|
||||||
|
#include <cstddef>
|
||||||
|
+#include <limits>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include <sys/ioctl.h>
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,17 +1,27 @@
|
||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
|
|
||||||
{
|
let
|
||||||
luwen = pkgs.rustPlatform.buildRustPackage rec {
|
|
||||||
pname = "luwen";
|
# Upstream does not vendor a lock file so one has to created manually
|
||||||
version = "unstable-2024-09-13";
|
# `cargo generate-lockfile`
|
||||||
|
# Use verson needed by tt-smi
|
||||||
|
# https://github.com/tenstorrent/tt-smi/blob/main/pyproject.toml#L30
|
||||||
|
version = "0.4.9";
|
||||||
|
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "tenstorrent";
|
owner = "tenstorrent";
|
||||||
repo = "luwen";
|
repo = "luwen";
|
||||||
rev = "e4e10e95928f4b73d31ac4f41ea08cd6e3ef5573";
|
rev = "refs/tags/v${version}";
|
||||||
sha256 = "sha256-cScaqWAyjDuvy9M2EccMfUHfDq23IWniaKeq+upHzOg=";
|
sha256 = "sha256-K68PjccE2fBkU4RvKv8X6jKRPYqsVhKB6jU92aajLgo=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
luwen = pkgs.rustPlatform.buildRustPackage rec {
|
||||||
|
pname = "luwen";
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
ln -s ${./Cargo_0_2.lock} Cargo.lock
|
ln -s ${./Cargo_0_2.lock} Cargo.lock
|
||||||
'';
|
'';
|
||||||
|
@ -22,14 +32,7 @@
|
||||||
|
|
||||||
pyluwen = pkgs.python3.pkgs.buildPythonPackage rec {
|
pyluwen = pkgs.python3.pkgs.buildPythonPackage rec {
|
||||||
pname = "pyluwen";
|
pname = "pyluwen";
|
||||||
version = "unstable-2024-09-13";
|
inherit version src;
|
||||||
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "tenstorrent";
|
|
||||||
repo = "luwen";
|
|
||||||
rev = "e4e10e95928f4b73d31ac4f41ea08cd6e3ef5573";
|
|
||||||
sha256 = "sha256-cScaqWAyjDuvy9M2EccMfUHfDq23IWniaKeq+upHzOg=";
|
|
||||||
};
|
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
ln -s ${./Cargo_0_2.lock} Cargo.lock
|
ln -s ${./Cargo_0_2.lock} Cargo.lock
|
||||||
|
@ -52,39 +55,4 @@
|
||||||
"pyluwen"
|
"pyluwen"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
pyluwen_0_1 = pkgs.python3.pkgs.buildPythonPackage rec {
|
|
||||||
pname = "pyluwen";
|
|
||||||
version = "v0.1.0";
|
|
||||||
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "tenstorrent";
|
|
||||||
repo = "luwen";
|
|
||||||
rev = "${version}";
|
|
||||||
sha256 = "sha256-MyOzm3dfEkL7MsVzV51DaO+Op3+QhUzsYCTDsvYsvpk=";
|
|
||||||
};
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
ln -s ${./Cargo_0_1.lock} Cargo.lock
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildAndTestSubdir = "crates/pyluwen";
|
|
||||||
|
|
||||||
format = "pyproject";
|
|
||||||
|
|
||||||
cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
|
|
||||||
inherit src postPatch;
|
|
||||||
name = "${pname}-${version}";
|
|
||||||
hash = "sha256-ZXcj/pzQ/tAROdmi2w+AWYBvLSEZFayizxw+BmNDj70=";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
pkgs.rustPlatform.cargoSetupHook
|
|
||||||
pkgs.rustPlatform.maturinBuildHook
|
|
||||||
];
|
|
||||||
|
|
||||||
pythonImportsCheck = [
|
|
||||||
"pyluwen"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ let
|
||||||
llvmPackages = llvmPackages_17;
|
llvmPackages = llvmPackages_17;
|
||||||
depsDir = "deps";
|
depsDir = "deps";
|
||||||
|
|
||||||
version = "unstable-2024-10-04";
|
version = "0.53.0";
|
||||||
|
|
||||||
metal-deps = metal.overrideAttrs (previousAttrs: {
|
metal-deps = metal.overrideAttrs (previousAttrs: {
|
||||||
name = "tt-metal-deps-${version}.tar.gz";
|
name = "tt-metal-deps-${version}.tar.gz";
|
||||||
|
@ -63,8 +63,8 @@ let
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "tenstorrent";
|
owner = "tenstorrent";
|
||||||
repo = "tt-metal";
|
repo = "tt-metal";
|
||||||
rev = "697ccc724048108e9f11a3c9ed5171a17ac9fd9c";
|
rev = "154e6993aed78213446c59731e41c3617d83c1f1";
|
||||||
hash = "sha256-pBfJAtSyRKtU3iG2P3hVuo2LXHBFOU+3XmRkbDuDvDQ=";
|
hash = "sha256-edtlE4CVsTO4BW0PKhkN0IxdV666Tu/Y1jgZ2Exljeo=";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
fetchLFS = true;
|
fetchLFS = true;
|
||||||
};
|
};
|
||||||
|
@ -106,7 +106,7 @@ let
|
||||||
substituteInPlace tt_metal/hw/CMakeLists.txt \
|
substituteInPlace tt_metal/hw/CMakeLists.txt \
|
||||||
--replace-fail "FetchContent_MakeAvailable(sfpi)" ""
|
--replace-fail "FetchContent_MakeAvailable(sfpi)" ""
|
||||||
mkdir -p runtime
|
mkdir -p runtime
|
||||||
ln -s ${sfpi.sfpi} runtime/sfpi
|
ln -s ${sfpi.prebuilt} runtime/sfpi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
ARCH_NAME = "wormhole_b0";
|
ARCH_NAME = "wormhole_b0";
|
||||||
|
@ -118,6 +118,7 @@ let
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DCPM_SOURCE_CACHE=${depsDir}"
|
"-DCPM_SOURCE_CACHE=${depsDir}"
|
||||||
|
"-DBUILD_PROGRAMMING_EXAMPLES=TRUE"
|
||||||
];
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
@ -132,6 +133,11 @@ let
|
||||||
sed -i "s|/build/source|/suild/source|g" "$f"
|
sed -i "s|/build/source|/suild/source|g" "$f"
|
||||||
sed -i 's|$ORIGIN/build/lib:|$ORIGIN/suild/lib:|g' "$f"
|
sed -i 's|$ORIGIN/build/lib:|$ORIGIN/suild/lib:|g' "$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Using tt-metal tries to write to <storepath>/built
|
||||||
|
# Create the built dir so a writable dir can be bind mounted to it
|
||||||
|
mkdir $out/built
|
||||||
|
mkdir $out/generated
|
||||||
'';
|
'';
|
||||||
|
|
||||||
dontPatchELF = true;
|
dontPatchELF = true;
|
||||||
|
|
|
@ -103,6 +103,14 @@ let
|
||||||
--replace-fail '$ENV{TT_METAL_HOME}/build/lib' '${metal}/lib ${metal}/build/lib'
|
--replace-fail '$ENV{TT_METAL_HOME}/build/lib' '${metal}/lib ${metal}/build/lib'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# No default install target
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
pwd
|
||||||
|
install -D sources/examples/sample_app/sample_app $out/bin/sample_app
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DCPM_SOURCE_CACHE=${depsDir}"
|
"-DCPM_SOURCE_CACHE=${depsDir}"
|
||||||
];
|
];
|
||||||
|
|
|
@ -27,5 +27,32 @@ rec {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
prebuilt = pkgs.stdenv.mkDerivation rec {
|
||||||
|
pname = "tt-gcc";
|
||||||
|
version = "5.0.0";
|
||||||
|
|
||||||
|
src = pkgs.fetchzip {
|
||||||
|
url = "https://github.com/tenstorrent/sfpi/releases/download/v5.0.0/sfpi-release.tgz";
|
||||||
|
hash = "sha256-RBhJ6BWmvB06zWoELTumpzroHDMpNXU0/WC6elgAkW0=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
libmpc
|
||||||
|
mpfr
|
||||||
|
gmp
|
||||||
|
zlib
|
||||||
|
expat
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
cp -r . $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
tt-gcc = import ./tt-gcc.nix { inherit pkgs; };
|
tt-gcc = import ./tt-gcc.nix { inherit pkgs; };
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,13 +8,13 @@ with pkgs.python3Packages;
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "tt-smi";
|
pname = "tt-smi";
|
||||||
version = "unstable-2024-09-27";
|
version = "3.0.5";
|
||||||
|
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "tenstorrent";
|
owner = "tenstorrent";
|
||||||
repo = "tt-smi";
|
repo = "tt-smi";
|
||||||
rev = "052f1ce49b94581710744a91939121e01c24b5f2";
|
rev = "refs/tags/v${version}";
|
||||||
hash = "sha256-IA60unZpSWVnMnDjDIC31QtURi9nIr/F7s7PGZilPcw=";
|
hash = "sha256-+Dw6F9aupe4VTWQFiNWGKMDOTmxwCW2bHuDQxWxluUc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
format = "pyproject";
|
format = "pyproject";
|
||||||
|
@ -39,7 +39,6 @@ buildPythonPackage rec {
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
setuptools
|
setuptools
|
||||||
requests
|
requests
|
||||||
textual
|
|
||||||
black
|
black
|
||||||
distro
|
distro
|
||||||
elasticsearch
|
elasticsearch
|
||||||
|
@ -51,5 +50,14 @@ buildPythonPackage rec {
|
||||||
importlib-resources
|
importlib-resources
|
||||||
pkgs.pre-commit
|
pkgs.pre-commit
|
||||||
tools-common
|
tools-common
|
||||||
|
tools-common.textual
|
||||||
];
|
];
|
||||||
|
|
||||||
|
dontUsePytestCheck = true; # no tests
|
||||||
|
|
||||||
|
installCheckPhase = ''
|
||||||
|
output=$($out/bin/tt-smi || true)
|
||||||
|
echo "tt-smi output: $output"
|
||||||
|
echo $output | grep -q "No Tenstorrent driver detected"
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,8 @@ stdenv.mkDerivation rec {
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
install -Dm444 -t $out/lib/systemd/system/ "tenstorrent-hugepages.service"
|
install -Dm444 -t $out/lib/systemd/system/ "tenstorrent-hugepages.service"
|
||||||
install -Dm444 -t $out/lib/systemd/system/ 'dev-hugepages\x2d1G.mount'
|
# Defined in the module
|
||||||
|
#install -Dm444 -t $out/lib/systemd/system/ 'dev-hugepages\x2d1G.mount'
|
||||||
install -Dm555 -t $out/libexec/ "hugepages-setup.sh"
|
install -Dm555 -t $out/libexec/ "hugepages-setup.sh"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
|
@ -43,14 +44,17 @@ stdenv.mkDerivation rec {
|
||||||
substituteInPlace "$out/lib/systemd/system/tenstorrent-hugepages.service" \
|
substituteInPlace "$out/lib/systemd/system/tenstorrent-hugepages.service" \
|
||||||
--replace-fail "/opt/tenstorrent/bin/hugepages-setup.sh" "$out/libexec/hugepages-setup.sh"
|
--replace-fail "/opt/tenstorrent/bin/hugepages-setup.sh" "$out/libexec/hugepages-setup.sh"
|
||||||
|
|
||||||
wrapProgram "$out/libexec/hugepages-setup.sh" \
|
mv "$out/libexec/hugepages-setup.sh" "$out/libexec/.hugepages-setup.sh-wrapped"
|
||||||
|
makeWrapper ${bash}/bin/bash "$out/libexec/hugepages-setup.sh" \
|
||||||
--prefix PATH : ${
|
--prefix PATH : ${
|
||||||
lib.makeBinPath [
|
lib.makeBinPath [
|
||||||
coreutils
|
coreutils
|
||||||
pciutils
|
pciutils
|
||||||
gawk
|
gawk
|
||||||
]
|
]
|
||||||
}
|
} \
|
||||||
|
--add-flags "-x $out/libexec/.hugepages-setup.sh-wrapped"
|
||||||
|
# add -x easier debugging
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
|
@ -1,21 +1,37 @@
|
||||||
{ pkgs }:
|
{ fetchFromGitHub, python3Packages }:
|
||||||
|
|
||||||
with pkgs.python3Packages;
|
let
|
||||||
|
# Can be unpinned once https://github.com/tenstorrent/tt-tools-common/blob/main/pyproject.toml#L32
|
||||||
|
# is v1
|
||||||
|
textual_0_82 = python3Packages.textual.overridePythonAttrs (old: rec {
|
||||||
|
version = "0.82.0";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "Textualize";
|
||||||
|
repo = "textual";
|
||||||
|
rev = "refs/tags/v${version}";
|
||||||
|
hash = "sha256-belpoXQ+CkTchK+FjI/Ur8v4cNgzX39xLdNfPCwaU6E=";
|
||||||
|
};
|
||||||
|
disabledTests = old.disabledTests ++ [
|
||||||
|
"test_selection"
|
||||||
|
];
|
||||||
|
});
|
||||||
|
in
|
||||||
|
|
||||||
buildPythonPackage rec {
|
python3Packages.buildPythonPackage rec {
|
||||||
pname = "tools-common";
|
pname = "tools-common";
|
||||||
version = "unstable-2024-09-27";
|
# https://github.com/tenstorrent/tt-smi/blob/main/pyproject.toml#L31
|
||||||
|
version = "1.4.11";
|
||||||
|
|
||||||
src = pkgs.fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "tenstorrent";
|
owner = "tenstorrent";
|
||||||
repo = "tt-tools-common";
|
repo = "tt-tools-common";
|
||||||
rev = "a89b2db6d086698ab0351a820ea689b4809429a3";
|
rev = "refs/tags/v${version}";
|
||||||
sha256 = "sha256-xeiJQkWsg9p8re2XJai0mNWuP7LwJ9faj3+Z3U/KvzI=";
|
sha256 = "sha256-Q5GpT6B3pamY6bUjPbvNJ11npiR4q/6QMjRxovQ/MZ0=";
|
||||||
};
|
};
|
||||||
|
|
||||||
format = "pyproject";
|
format = "pyproject";
|
||||||
|
|
||||||
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
nativeBuildInputs = with python3Packages; [ pythonRelaxDepsHook ];
|
||||||
|
|
||||||
pythonRelaxDeps = [
|
pythonRelaxDeps = [
|
||||||
"distro"
|
"distro"
|
||||||
|
@ -28,14 +44,14 @@ buildPythonPackage rec {
|
||||||
"tqdm"
|
"tqdm"
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = with python3Packages; [
|
||||||
setuptools
|
setuptools
|
||||||
distro
|
distro
|
||||||
elasticsearch
|
elasticsearch
|
||||||
psutil
|
psutil
|
||||||
pyyaml
|
pyyaml
|
||||||
rich
|
rich
|
||||||
textual
|
textual_0_82
|
||||||
requests
|
requests
|
||||||
jsons
|
jsons
|
||||||
tqdm
|
tqdm
|
||||||
|
@ -45,4 +61,8 @@ buildPythonPackage rec {
|
||||||
pythonImportsCheck = [
|
pythonImportsCheck = [
|
||||||
"tt_tools_common"
|
"tt_tools_common"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
textual = textual_0_82;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue