Something went wrong. Try again.
Nix Packages collection & NixOS github.com/NixOS/nixpkgs
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154{ lib, config, buildPythonPackage, fetchFromGitHub, cudaPackages, replaceVars,
# build-system cmake, cython, ninja, scikit-build-core, setuptools-scm,
# dependencies cuda-bindings, cuda-core, cuda-pathfinder, numpy, typing-extensions,
# tests cupy, pytestCheckHook,
# passthru nix-update-script,}:
buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } (finalAttrs: { pname = "cuda-cccl"; version = "1.3.0"; pyproject = true; __structuredAttrs = true;
src = fetchFromGitHub { owner = "NVIDIA"; repo = "cccl"; tag = "python-${finalAttrs.version}"; hash = "sha256-3lPANIBPFP/U8S3sMiA9jPvHD3/k7kwEt8qkXd57Avw="; };
sourceRoot = "${finalAttrs.src.name}/python/cuda_cccl"; # Some patches touch files outside of sourceRoot postUnpack = '' chmod -R u+w -- "$sourceRoot/../.." '';
patches = [ (replaceVars ./patch-nvidia-libs-paths.patch { libnvjitlink = lib.getLib cudaPackages.libnvjitlink; libnvrtc = lib.getLib cudaPackages.cuda_nvrtc; })
# Disable all tests requiring unpackaged `numba-cuda-mlir` through `cuda.compute` ./skip-missing-jit-backend.patch ]; # Apply patches from the repository root (parent of sourceRoot) patchFlags = [ "-p1" "-d" "../.." ];
postPatch = '' substituteInPlace cuda/cccl/headers/include_paths.py \ --replace-fail \ 'find_nvidia_header_directory("cudart")' \ '"${lib.getInclude cudaPackages.cuda_cudart}/include"' '';
build-system = [ cmake cython ninja scikit-build-core setuptools-scm ]; dontUseCmakeConfigure = true;
nativeBuildInputs = [ cudaPackages.cuda_nvcc ];
buildInputs = with cudaPackages; [ cuda_cudart # cuda_runtime.h cuda_nvrtc # nvrtc.h libnvjitlink ];
dependencies = [ cuda-bindings cuda-core cuda-pathfinder numpy typing-extensions ];
pythonImportsCheck = [ "cuda.cccl" "cuda.compute" ];
nativeCheckInputs = [ cupy pytestCheckHook ];
preCheck = '' rm -rf cuda '' # Otherwise, cupy will try to write in $HOME (/homeless-shelter) + '' export CUPY_CACHE_DIR=$(mktemp -d) '';
disabledTests = [ # Sorts 2**28 elements, which does not fit in the test runner's memory pool # RuntimeError: Failed to allocate memory from pool "test_radix_sort_large_num_items" ];
disabledTestPaths = [ # Require the unpackaged `numba-cuda-mlir` JIT backend # ModuleNotFoundError: No module named 'numba_cuda_mlir' "tests/compute/test_jit_backend.py" "tests/compute/test_void_ptr_wrapper_validation.py" ];
# Tests require access to a GPU doCheck = false; passthru = { gpuCheck = finalAttrs.finalPackage.overrideAttrs { requiredSystemFeatures = [ "cuda" ]; doInstallCheck = true; };
updateScript = nix-update-script { extraArgs = [ "--version-regex=python-(.*)" ]; }; };
meta = { description = "CUDA Core Compute Libraries for Python"; homepage = "https://github.com/NVIDIA/cccl/tree/main/python/cuda_cccl"; changelog = "https://github.com/NVIDIA/cccl/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.asl20; teams = [ lib.teams.cuda ]; maintainers = with lib.maintainers; [ GaetanLepage ]; broken = !config.cudaSupport; };})