tt-umd: init 0.9.6

This commit is contained in:
Tristan Ross
2026-06-05 13:24:44 -07:00
parent 2aa8307146
commit d4e7b4faab
2 changed files with 149 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 96d71990..1db71f88 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -43,6 +43,7 @@ CPMAddPackage(
"YAML_CPP_BUILD_TESTS OFF"
"YAML_CPP_BUILD_TOOLS OFF"
"YAML_BUILD_SHARED_LIBS OFF"
+ FIND_PACKAGE_ARGUMENTS GLOBAL
)
if(yaml-cpp_ADDED)
@@ -146,7 +147,13 @@ CPMAddPackage(
####################################################################################################################
# tt-logger
####################################################################################################################
-CPMAddPackage(NAME tt-logger GITHUB_REPOSITORY tenstorrent/tt-logger VERSION 1.1.8 SYSTEM YES)
+CPMAddPackage(
+ NAME tt-logger
+ GITHUB_REPOSITORY tenstorrent/tt-logger
+ VERSION 1.1.8
+ SYSTEM YES
+ FIND_PACKAGE_ARGUMENTS GLOBAL
+)
####################################################################################################################
# cxxopts
@@ -159,6 +166,7 @@ CPMAddPackage(
SYSTEM YES
OPTIONS
"CMAKE_MESSAGE_LOG_LEVEL NOTICE"
+ FIND_PACKAGE_ARGUMENTS GLOBAL
)
####################################################################################################################
+114
View File
@@ -0,0 +1,114 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchurl,
cmake,
ninja,
pkg-config,
gtest,
yaml-cpp,
fmt,
nanobench,
spdlog,
tt-logger,
cxxopts,
hwloc,
python3,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "tt-umd";
version = "0.9.6";
__structuredAttrs = true;
strictDeps = true;
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "tenstorrent";
repo = "tt-umd";
tag = "v${finalAttrs.version}";
hash = "sha256-3IrgsKRaJP/rEXiMvi2LnzS9n2+Giu5d05RohzRgPw4=";
};
cpm = fetchurl {
url = "https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.40.2/CPM.cmake";
hash = "sha256-yM3DLAOBZTjOInge1ylk3IZLKjSjENO3EEgSpcotg10=";
};
patches = [
# https://github.com/tenstorrent/tt-umd/pull/2187
./fix-targets.patch
];
postPatch = ''
cp $cpm cmake/CPM.cmake
'';
nativeBuildInputs = [
cmake
ninja
pkg-config
python3
];
buildInputs = [
fmt
yaml-cpp
nanobench
spdlog
tt-logger
cxxopts
python3.pkgs.nanobind
hwloc
gtest
];
cmakeFlags = [
(lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true)
(lib.cmakeBool "CPM_USE_LOCAL_PACKAGES_ONLY" true)
(lib.cmakeBool "CPM_LOCAL_PACKAGES_ONLY" true)
(lib.cmakeFeature "umd_asio_SOURCE_DIR" (
builtins.toString (fetchFromGitHub {
owner = "chriskohlhoff";
repo = "asio";
tag = "asio-1-30-2";
hash = "sha256-g+ZPKBUhBGlgvce8uTkuR983unD2kbQKgoddko7x+fk=";
})
))
(lib.cmakeBool "TT_UMD_BUILD_TESTS" finalAttrs.doCheck)
(lib.cmakeBool "TT_UMD_BUILD_STATIC" stdenv.hostPlatform.isStatic)
(lib.cmakeBool "TT_UMD_BUILD_PYTHON" true)
(lib.cmakeFeature "nanobind_DIR" "${python3.pkgs.nanobind}/${python3.sitePackages}/nanobind/cmake")
];
postInstall = ''
mkdir -p $out/${python3.sitePackages}
mv $out/tt_umd $out/${python3.sitePackages}/tt_umd
rm $out/libtt-umd.so.*
mkdir -p $out/${python3.sitePackages}/tt_umd-${finalAttrs.version}.dist-info
cat > $out/${python3.sitePackages}/tt_umd-${finalAttrs.version}.dist-info/METADATA <<EOF
Metadata-Version: 2.1
Name: tt-umd
Version: ${finalAttrs.version}
EOF
'';
nativeCheckInputs = [
gtest
];
doCheck = true;
meta = {
description = "User-Mode Driver for Tenstorrent hardware";
homepage = "https://github.com/tenstorrent/tt-umd";
maintainers = with lib.maintainers; [ RossComputerGuy ];
license = with lib.licenses; [ asl20 ];
platforms = lib.platforms.linux;
};
})