it builds
This commit is contained in:
1 parent
634d1024d7
commit
e68b8f8fb5
2 files changed
+38
-9
No files matched your search
@@ -117,6 +117,8 @@ in
|
|||||||
ollama-rocm
|
ollama-rocm
|
||||||
# stable-diffusion-cpp-rocm
|
# stable-diffusion-cpp-rocm
|
||||||
lmstudio
|
lmstudio
|
||||||
|
# DwarfStar (antirez/ds4) — ROCm build for Strix Halo (gfx1151).
|
||||||
|
ds4-rocm
|
||||||
|
|
||||||
# Hermes gateway - Signal bridge (used to link the device + run the daemon)
|
# Hermes gateway - Signal bridge (used to link the device + run the daemon)
|
||||||
signal-cli
|
signal-cli
|
||||||
@@ -132,6 +134,14 @@ in
|
|||||||
gamescopeSession.enable = true;
|
gamescopeSession.enable = true;
|
||||||
};
|
};
|
||||||
boot.kernelPackages = pkgs.linuxPackages; # (this is the default) some amdgpu issues on 6.10
|
boot.kernelPackages = pkgs.linuxPackages; # (this is the default) some amdgpu issues on 6.10
|
||||||
|
# Strix Halo GTT memory tuning so the full 128 GB unified memory is GPU-visible
|
||||||
|
# (required by ds4-rocm / large models per upstream STRIXHALO.md).
|
||||||
|
boot.kernelParams = [
|
||||||
|
"amd_iommu=off"
|
||||||
|
"amdgpu.gttsize=126976"
|
||||||
|
"ttm.pages_limit=32505856"
|
||||||
|
"ttm.page_pool_size=32505856"
|
||||||
|
];
|
||||||
programs = {
|
programs = {
|
||||||
gamescope = {
|
gamescope = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
+28
-9
@@ -37,6 +37,7 @@ let
|
|||||||
rocmInputs = [
|
rocmInputs = [
|
||||||
rocmPackages.clr # provides hipcc + HIP runtime
|
rocmPackages.clr # provides hipcc + HIP runtime
|
||||||
rocmPackages.hipblas
|
rocmPackages.hipblas
|
||||||
|
rocmPackages.hipblas-common # hipblas.h includes hipblas-common/hipblas-common.h
|
||||||
rocmPackages.hipblaslt
|
rocmPackages.hipblaslt
|
||||||
rocmPackages.rocblas
|
rocmPackages.rocblas
|
||||||
rocmPackages.rocwmma # gfx1151 backend uses rocWMMA headers
|
rocmPackages.rocwmma # gfx1151 backend uses rocWMMA headers
|
||||||
@@ -74,23 +75,35 @@ let
|
|||||||
|
|
||||||
# Per-backend command-line variable overrides (forwarded to the recursive
|
# Per-backend command-line variable overrides (forwarded to the recursive
|
||||||
# sub-make as MAKEOVERRIDES, beating the Makefile's `?=` defaults).
|
# sub-make as MAKEOVERRIDES, beating the Makefile's `?=` defaults).
|
||||||
|
#
|
||||||
|
# `makeFlags` entries are expanded UNQUOTED by the generic builder, so any
|
||||||
|
# value containing spaces (CFLAGS/LDLIBS) would be word-split and make would
|
||||||
|
# treat the extra words as bogus options. Those go through `makeFlagsArray`
|
||||||
|
# (a quoted bash array, set in preBuild) instead; only space-free assignments
|
||||||
|
# may live in `makeFlags`.
|
||||||
backendMakeFlags = {
|
backendMakeFlags = {
|
||||||
cpu = [ ];
|
cpu = [ ];
|
||||||
|
rocm = [ "ROCM_ARCH=${rocmArch}" ];
|
||||||
rocm = [
|
|
||||||
"ROCM_ARCH=${rocmArch}"
|
|
||||||
# Append store include/lib paths to the upstream ROCm flags.
|
|
||||||
"ROCM_CFLAGS=-O3 -ffast-math -g -fno-finite-math-only -pthread -D__HIP_PLATFORM_AMD__ -Wno-unused-command-line-argument --offload-arch=${rocmArch} ${rocmIncludeFlags}"
|
|
||||||
"ROCM_LDLIBS=-lm -pthread ${rocmLinkFlags} -lhipblas -lhipblaslt"
|
|
||||||
];
|
|
||||||
|
|
||||||
cuda = [
|
cuda = [
|
||||||
"NVCC=${lib.getExe' cudaPackages.cuda_nvcc "nvcc"}"
|
"NVCC=${lib.getExe' cudaPackages.cuda_nvcc "nvcc"}"
|
||||||
"CUDA_HOME=${cudaPackages.cuda_nvcc}"
|
"CUDA_HOME=${cudaPackages.cuda_nvcc}"
|
||||||
|
] ++ lib.optional (cudaArch != null) "CUDA_ARCH=${cudaArch}";
|
||||||
|
}.${backend};
|
||||||
|
|
||||||
|
# Space-containing variable assignments (must survive word splitting).
|
||||||
|
backendMakeFlagsArray = {
|
||||||
|
cpu = [ ];
|
||||||
|
rocm = [
|
||||||
|
# Append store include/lib paths to the upstream ROCm flags (hipcc is the
|
||||||
|
# raw ROCm compiler, not the nix cc-wrapper, so it needs explicit -I/-L).
|
||||||
|
"ROCM_CFLAGS=-O3 -ffast-math -g -fno-finite-math-only -pthread -D__HIP_PLATFORM_AMD__ -Wno-unused-command-line-argument --offload-arch=${rocmArch} ${rocmIncludeFlags}"
|
||||||
|
"ROCM_LDLIBS=-lm -pthread ${rocmLinkFlags} -lhipblas -lhipblaslt"
|
||||||
|
];
|
||||||
|
cuda = [
|
||||||
# Replace upstream's hardcoded /usr/local/cuda + sbsa-linux (aarch64)
|
# Replace upstream's hardcoded /usr/local/cuda + sbsa-linux (aarch64)
|
||||||
# paths with the nixpkgs cudart/cublas store paths.
|
# paths with the nixpkgs cudart/cublas store paths.
|
||||||
"CUDA_LDLIBS=-lm -Xcompiler -pthread ${cudaLinkFlags} -lcudart -lcublas"
|
"CUDA_LDLIBS=-lm -Xcompiler -pthread ${cudaLinkFlags} -lcudart -lcublas"
|
||||||
] ++ lib.optional (cudaArch != null) "CUDA_ARCH=${cudaArch}";
|
];
|
||||||
}.${backend};
|
}.${backend};
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
@@ -120,6 +133,12 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
makeFlags = backendMakeFlags;
|
makeFlags = backendMakeFlags;
|
||||||
buildFlags = [ buildTarget ];
|
buildFlags = [ buildTarget ];
|
||||||
|
|
||||||
|
# Pass space-containing make variables as a quoted array so they aren't
|
||||||
|
# word-split (see backendMakeFlagsArray note above).
|
||||||
|
preBuild = lib.optionalString (backendMakeFlagsArray != [ ]) ''
|
||||||
|
makeFlagsArray+=(${lib.escapeShellArgs backendMakeFlagsArray})
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
install -Dm755 -t "$out/bin" ds4 ds4-server ds4-bench ds4-eval ds4-agent
|
install -Dm755 -t "$out/bin" ds4 ds4-server ds4-bench ds4-eval ds4-agent
|
||||||
|
|||||||
Reference in new issue
Block a user