Files
millerson-overlay.nix/packages/crucible-strix-halo/package.nix
T
2026-11-12 23:55:09 +03:00

93 lines
2.5 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchurl,
autoPatchelfHook,
makeWrapper,
python3,
therockRocm,
}:
let
python = python3.withPackages (ps: [
ps.numpy
ps.jinja2
ps.tokenizers
ps.pillow
]);
in
stdenv.mkDerivation (finalAttrs: {
pname = "crucible-strix-halo";
version = "0.37.0";
src = fetchFromGitHub {
owner = "jaedync";
repo = "crucible-strix-halo";
tag = "v${finalAttrs.version}";
hash = "sha256-Uv7/bM0zLc01hciLSdvY9fHJdpSYoOrgSK6WwyWHnWQ=";
};
# Upstream built this release engine with ROCm 7.2.4 and tested it on ROCm 10.1.
# Keep the official gfx1151 code objects.
engine = fetchurl {
url = "https://github.com/jaedync/crucible-strix-halo/releases/download/v${finalAttrs.version}/crucible-engine-v${finalAttrs.version}-gfx1151-rocm7.2-linux-x86_64.gz";
hash = "sha256-U6P7SRFB86QgXQljvBQwTm8dNFHV5OrPEb/JkxX6Uzo=";
};
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
];
buildInputs = [
therockRocm
stdenv.cc.cc.lib
];
dontBuild = true;
dontStrip = true;
doCheck = true;
checkPhase = ''
runHook preCheck
${python}/bin/python -m unittest server.tests.test_api server.tests.test_template
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/crucible/build/engine
gzip -dc $engine > $out/share/crucible/build/engine/crucible
chmod +x $out/share/crucible/build/engine/crucible
ln -s ../share/crucible/build/engine/crucible $out/bin/crucible-engine
cp -r server $out/share/crucible/
cp VERSION LICENSE NOTICE $out/share/crucible/
makeWrapper ${python}/bin/python $out/bin/crucible-server \
--add-flags "-m server" \
--prefix PYTHONPATH : $out/share/crucible \
--set-default CRUCIBLE_NO_UPDATE_CHECK 1
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/crucible-engine --version | grep -Fx 'crucible ${finalAttrs.version}'
$out/bin/crucible-server --version | grep -Fx 'crucible ${finalAttrs.version}'
$out/bin/crucible-server --help > /dev/null
runHook postInstallCheck
'';
passthru = {
rocm = therockRocm;
category = "AI Inference";
};
meta = {
description = "Crucible EXL3 inference engine and OpenAI-compatible server for AMD Strix Halo";
homepage = "https://github.com/jaedync/crucible-strix-halo";
license = lib.licenses.asl20;
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
platforms = [ "x86_64-linux" ];
mainProgram = "crucible-server";
};
})