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 {
34 rev = "refs/tags/v${version}";
35 hash = "sha256-2NcKb2SWU/vNsnd2KhdU85J60fJPuc44ZxIle/1UT6g=";
41 ] ++ lib.optionals cudaSupport [
42 cudaPackages.cuda_nvcc
54 ] ++ lib.optionals cudaSupport [
55 cudaPackages.cuda_cudart
58 env.TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" python3.pkgs.torch.cudaCapabilities}";
61 (lib.cmakeBool "CMAKE_SKIP_RPATH" true)
62 (lib.cmakeFeature "FETCHCONTENT_TRY_FIND_PACKAGE_MODE" "ALWAYS")
63 ] ++ lib.optionals cudaSupport [
64 (lib.cmakeFeature "GPU_RUNTIME" "CUDA")
65 (lib.cmakeFeature "CUDA_TOOLKIT_ROOT_DIR" "${cudaPackages.cudatoolkit}/")
68 passthru.updateScript = nix-update-script { };
71 description = "Production-grade 3D gaussian splatting";
72 homepage = "https://github.com/pierotofy/OpenSplat/";
75 lib.licenses.agpl3Only
76 # vendored+modified gsplat
79 maintainers = [ lib.maintainers.jcaesar ];
80 platforms = lib.platforms.linux ++ lib.optionals (!cudaSupport) lib.platforms.darwin;