15 # Upstream has rocm/hip support, too. anyone?
16 cudaSupport ? config.cudaSupport,
22 torch = python3.pkgs.torch.override { inherit cudaSupport; };
23 # Using a normal stdenv with cuda torch gives
24 # ld: /nix/store/k1l7y96gv0nc685cg7i3g43i4icmddzk-python3.11-torch-2.2.1-lib/lib/libc10.so: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32'
25 stdenv' = if cudaSupport then cudaPackages.backendStdenv else stdenv;
27 stdenv'.mkDerivation {
31 src = fetchFromGitHub {
35 hash = "sha256-u2UmD0O3sUWELYb4CjQE19i4HUjLMcaWqOinQH0PPTM=";
43 ++ lib.optionals cudaSupport [
44 cudaPackages.cuda_nvcc
58 ++ lib.optionals cudaSupport [
59 cudaPackages.cuda_cudart
62 env.TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" python3.pkgs.torch.cudaCapabilities}";
66 (lib.cmakeBool "CMAKE_SKIP_RPATH" true)
67 (lib.cmakeFeature "FETCHCONTENT_TRY_FIND_PACKAGE_MODE" "ALWAYS")
69 ++ lib.optionals cudaSupport [
70 (lib.cmakeFeature "GPU_RUNTIME" "CUDA")
71 (lib.cmakeFeature "CUDA_TOOLKIT_ROOT_DIR" "${cudaPackages.cudatoolkit}/")
74 passthru.updateScript = nix-update-script { };
77 description = "Production-grade 3D gaussian splatting";
78 homepage = "https://github.com/pierotofy/OpenSplat/";
81 lib.licenses.agpl3Only
82 # vendored+modified gsplat
85 maintainers = [ lib.maintainers.jcaesar ];
86 platforms = lib.platforms.linux ++ lib.optionals (!cudaSupport) lib.platforms.darwin;