From 5660af24f744e773268cecad61085a6dea2ef702 Mon Sep 17 00:00:00 2001 From: Matthew Deville Date: Thu, 23 Apr 2026 17:36:20 +0200 Subject: [PATCH] depdency for cuda --- Cargo.toml | 2 +- flake.lock | 6 +++--- flake.nix | 28 ++++++++++++++++++++++------ 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 55669c1..410879c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ hex = "0.4" image = "0.25" ndarray = "0.17" - ort = "=2.0.0-rc.12" + ort = { version = "=2.0.0-rc.12", features = ["cuda"] } reqwest = { version = "0.13", features = ["blocking"] } sha2 = "0.11" show-image = { version = "0.14", features = ["image"] } diff --git a/flake.lock b/flake.lock index 7f44c84..afbf8ac 100644 --- a/flake.lock +++ b/flake.lock @@ -62,11 +62,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1776827647, - "narHash": "sha256-sYixYhp5V8jCajO8TRorE4fzs7IkL4MZdfLTKgkPQBk=", + "lastModified": 1776914043, + "narHash": "sha256-qug5r56yW1qOsjSI99l3Jm15JNT9CvS2otkXNRNtrPI=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "40e6ccc06e1245a4837cbbd6bdda64e21cc67379", + "rev": "2d35c4358d7de3a0e606a6e8b27925d981c01cc3", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c6ec191..6e54cef 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,10 @@ system: let overlays = [ (import rust-overlay) ]; - pkgs = import nixpkgs { inherit system overlays; }; + pkgs = import nixpkgs { + inherit system overlays; + config.allowUnfree = true; + }; stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv; rustToolchain = pkgs.rust-bin.stable.latest.default.override { extensions = [ "rust-src" ]; @@ -32,10 +35,10 @@ ]; xorgBuildInputs = with pkgs; [ - xorg.libx11 - xorg.libxcursor - xorg.libxi - xorg.libxrandr + libx11 + libxcursor + libxi + libxrandr ]; waylandBuildInputs = with pkgs; [ @@ -49,7 +52,20 @@ openssl ]; - buildInputs = xorgBuildInputs ++ waylandBuildInputs ++ graphicsBuildInputs; + # CUDA runtime libraries required by ONNX Runtime CUDA EP. + cudaBuildInputs = with pkgs.cudaPackages; [ + cuda_cudart + libcublas + libcurand + libcufft + cudnn + ]; + + buildInputs = + xorgBuildInputs + ++ waylandBuildInputs + ++ graphicsBuildInputs + ++ cudaBuildInputs; mkShell = pkgs.mkShell.override { stdenv = stdenv;