Skip to content

Commit

Permalink
Updated nix test to utilise nixgl for cuda library handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-arkinstall committed Oct 23, 2024
1 parent 1b9f7b5 commit 8525059
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 9 deletions.
54 changes: 52 additions & 2 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=
nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
'';
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.tket.url = "github:CQCL/tket";
inputs.nixpkgs.follows = "tket/nixpkgs";
outputs = { self, nixpkgs, flake-utils, tket }:
inputs = {
flake-utils.url = "github:numtide/flake-utils";
tket.url = "github:CQCL/tket";
nixpkgs.follows = "tket/nixpkgs";
nixgl.url = "github:nix-community/nixGL";
};
outputs = { self, nixpkgs, flake-utils, tket, nixgl }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
Expand All @@ -20,6 +23,8 @@
cudaSupport = true;
};
overlays = [
(nixgl.overlay)

(self: super: {
inherit (tket.packages."${system}") tket pytket;
})
Expand Down
8 changes: 5 additions & 3 deletions nix-support/pytket-cutensornet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ EOF
pytest
pytest-lazy-fixture
]);
nixgl-bin = self.lib.getExe self.nixgl.auto.nixGLNvidia;
in super.writeShellScriptBin "run-pytket-cutensornet-tests" ''
HOME=$(mktemp -d);
export HOME;
echo "---------------------------";
env;
echo "---------------------------";
NIXGL_PATH="$(${nixgl-bin} printenv LD_LIBRARY_PATH)";
WSL_PATH="/usr/lib/wsl/lib";
LD_LIBRARY_PATH="$NIXGL_PATH:$WSL_PATH:$LD_LIBRARY_PATH";
export LD_LIBRARY_PATH;
${test-env}/bin/pytest -s ${../tests};
'';
}

0 comments on commit 8525059

Please sign in to comment.