diff --git a/pkgs/applications/misc/gpu-burn/default.nix b/pkgs/applications/misc/gpu-burn/default.nix deleted file mode 100644 index 97d6b674d5e5..000000000000 --- a/pkgs/applications/misc/gpu-burn/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ lib, stdenv, fetchFromGitHub, addDriverRunpath, cudatoolkit }: - -stdenv.mkDerivation { - pname = "gpu-burn"; - version = "unstable-2023-11-10"; - - src = fetchFromGitHub { - owner = "wilicc"; - repo = "gpu-burn"; - rev = "b99aedce3e020d2ca419832ee27b7f29dfa6373e"; - sha256 = "sha256-cLO0GXvujZ+g64j+OY31n43MsVER3ljo8Qrt+EzSKjc="; - }; - - postPatch = '' - substituteInPlace gpu_burn-drv.cpp \ - --replace "#define COMPARE_KERNEL \"compare.ptx\"" \ - "#define COMPARE_KERNEL \"$out/share/compare.ptx\"" - ''; - - buildInputs = [ cudatoolkit ]; - - nativeBuildInputs = [ addDriverRunpath ]; - - makeFlags = [ "CUDAPATH=${cudatoolkit}" ]; - - LDFLAGS = "-L${cudatoolkit}/lib/stubs"; - - installPhase = '' - mkdir -p $out/{bin,share} - cp gpu_burn $out/bin/ - cp compare.ptx $out/share/ - ''; - - postFixup = '' - addDriverRunpath $out/bin/gpu_burn - ''; - - meta = with lib; { - homepage = "http://wili.cc/blog/gpu-burn.html"; - description = "Multi-GPU CUDA stress test"; - platforms = platforms.linux; - license = licenses.bsd2; - mainProgram = "gpu_burn"; - }; -} diff --git a/pkgs/by-name/gp/gpu-burn/package.nix b/pkgs/by-name/gp/gpu-burn/package.nix new file mode 100644 index 000000000000..d2b2bd45ea3a --- /dev/null +++ b/pkgs/by-name/gp/gpu-burn/package.nix @@ -0,0 +1,81 @@ +{ + autoAddDriverRunpath, + config, + cudaPackages, + fetchFromGitHub, + lib, +}: +let + inherit (lib.attrsets) getBin; + inherit (lib.lists) last map optionals; + inherit (lib.trivial) boolToString; + inherit (config) cudaSupport; + inherit (cudaPackages) + backendStdenv + cuda_cccl + cuda_cudart + cuda_nvcc + libcublas + ; + inherit (cudaPackages.cudaFlags) cudaCapabilities dropDot isJetsonBuild; +in +backendStdenv.mkDerivation { + pname = "gpu-burn"; + version = "unstable-2024-04-09"; + + strictDeps = true; + + src = fetchFromGitHub { + owner = "wilicc"; + repo = "gpu-burn"; + rev = "9aefd7c0cc603bbc8c3c102f5338c6af26f8127c"; + hash = "sha256-Nz0yaoHGfodaYl2HJ7p+1nasqRmxwPJ9aL9oxitXDpM="; + }; + + postPatch = '' + substituteInPlace gpu_burn-drv.cpp \ + --replace-fail \ + '#define COMPARE_KERNEL "compare.ptx"' \ + "#define COMPARE_KERNEL \"$out/share/compare.ptx\"" + ''; + + nativeBuildInputs = [ + autoAddDriverRunpath + cuda_nvcc + ]; + + buildInputs = [ + cuda_cccl # + cuda_cudart # driver_types.h + cuda_nvcc # crt/host_defines.h + libcublas # cublas_v2.h + ]; + + makeFlags = [ + "CUDAPATH=${getBin cuda_nvcc}" + "COMPUTE=${last (map dropDot cudaCapabilities)}" + "IS_JETSON=${boolToString isJetsonBuild}" + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share} + install -Dm755 gpu_burn $out/bin/ + install -Dm644 compare.ptx $out/share/ + runHook postInstall + ''; + + # NOTE: Certain packages may be missing from cudaPackages on non-Linux platforms. To avoid evaluation failure, + # we only include the platforms where we know the package is available -- thus the conditionals setting the + # platforms and badPlatforms fields. + meta = { + badPlatforms = optionals (!cudaSupport) lib.platforms.all; + broken = !cudaSupport; + description = "Multi-GPU CUDA stress test"; + homepage = "http://wili.cc/blog/gpu-burn.html"; + license = lib.licenses.bsd2; + mainProgram = "gpu_burn"; + maintainers = with lib.maintainers; [ connorbaker ]; + platforms = optionals cudaSupport lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 52ca9a5efcb9..1b834d9b7e6c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5274,12 +5274,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; - gpu-burn = callPackage ../applications/misc/gpu-burn { - # gpu-burn doesn't build on gcc11. CUDA 11.3 is the last version to use - # pre-gcc11, in particular gcc9. - stdenv = gcc9Stdenv; - }; - gpu-viewer = callPackage ../applications/misc/gpu-viewer { }; greg = callPackage ../applications/audio/greg {