File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 35
35
) ;
36
36
pkgs = import nixpkgs { inherit system ; } ;
37
37
nativeBuildInputs = with pkgs ; [ cmake ninja pkg-config ] ;
38
+ cudatoolkit_joined = with pkgs ; symlinkJoin {
39
+ # HACK(Green-Sky): nix currently has issues with cmake findcudatoolkit
40
+ # see https://github.com/NixOS/nixpkgs/issues/224291
41
+ # copied from jaxlib
42
+ name = "${ cudaPackages . cudatoolkit . name } -merged" ;
43
+ paths = [
44
+ cudaPackages . cudatoolkit . lib
45
+ cudaPackages . cudatoolkit . out
46
+ ] ++ lib . optionals ( lib . versionOlder cudaPackages . cudatoolkit . version "11" ) [
47
+ # for some reason some of the required libs are in the targets/x86_64-linux
48
+ # directory; not sure why but this works around it
49
+ "${ cudaPackages . cudatoolkit } /targets/${ system } "
50
+ ] ;
51
+ } ;
38
52
llama-python =
39
53
pkgs . python3 . withPackages ( ps : with ps ; [ numpy sentencepiece ] ) ;
40
54
postPatch = ''
70
84
"-DLLAMA_CLBLAST=ON"
71
85
] ;
72
86
} ;
87
+ packages . cuda = pkgs . stdenv . mkDerivation {
88
+ inherit name src meta postPatch nativeBuildInputs postInstall ;
89
+ buildInputs = with pkgs ; buildInputs ++ [ cudatoolkit_joined ] ;
90
+ cmakeFlags = cmakeFlags ++ [
91
+ "-DLLAMA_CUBLAS=ON"
92
+ ] ;
93
+ } ;
73
94
packages . rocm = pkgs . stdenv . mkDerivation {
74
95
inherit name src meta postPatch nativeBuildInputs postInstall ;
75
96
buildInputs = with pkgs ; buildInputs ++ [ hip hipblas rocblas ] ;
You can’t perform that action at this time.
0 commit comments