depdency for cuda

This commit is contained in:
Matthew Deville 2026-04-23 17:36:20 +02:00
parent c217578536
commit 5660af24f7
3 changed files with 26 additions and 10 deletions

View file

@ -9,7 +9,7 @@
hex = "0.4" hex = "0.4"
image = "0.25" image = "0.25"
ndarray = "0.17" ndarray = "0.17"
ort = "=2.0.0-rc.12" ort = { version = "=2.0.0-rc.12", features = ["cuda"] }
reqwest = { version = "0.13", features = ["blocking"] } reqwest = { version = "0.13", features = ["blocking"] }
sha2 = "0.11" sha2 = "0.11"
show-image = { version = "0.14", features = ["image"] } show-image = { version = "0.14", features = ["image"] }

View file

@ -62,11 +62,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1776827647, "lastModified": 1776914043,
"narHash": "sha256-sYixYhp5V8jCajO8TRorE4fzs7IkL4MZdfLTKgkPQBk=", "narHash": "sha256-qug5r56yW1qOsjSI99l3Jm15JNT9CvS2otkXNRNtrPI=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "40e6ccc06e1245a4837cbbd6bdda64e21cc67379", "rev": "2d35c4358d7de3a0e606a6e8b27925d981c01cc3",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -18,7 +18,10 @@
system: system:
let let
overlays = [ (import rust-overlay) ]; 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; stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv;
rustToolchain = pkgs.rust-bin.stable.latest.default.override { rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ]; extensions = [ "rust-src" ];
@ -32,10 +35,10 @@
]; ];
xorgBuildInputs = with pkgs; [ xorgBuildInputs = with pkgs; [
xorg.libx11 libx11
xorg.libxcursor libxcursor
xorg.libxi libxi
xorg.libxrandr libxrandr
]; ];
waylandBuildInputs = with pkgs; [ waylandBuildInputs = with pkgs; [
@ -49,7 +52,20 @@
openssl 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 { mkShell = pkgs.mkShell.override {
stdenv = stdenv; stdenv = stdenv;