cudatoolkit8: 8.0.61 -> 8.0.88
This requires a refactor so that we support binary patches from NVIDIA.
This commit is contained in:
parent
3179002f61
commit
cac556be8d
@ -11,11 +11,12 @@ let
|
|||||||
, name ? ""
|
, name ? ""
|
||||||
, developerProgram ? false
|
, developerProgram ? false
|
||||||
, python ? python27
|
, python ? python27
|
||||||
|
, runPatches ? []
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "cudatoolkit-${version}";
|
name = "cudatoolkit-${version}";
|
||||||
inherit (args) version;
|
inherit version runPatches;
|
||||||
|
|
||||||
dontPatchELF = true;
|
dontPatchELF = true;
|
||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
@ -48,35 +49,34 @@ let
|
|||||||
|
|
||||||
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64";
|
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64";
|
||||||
|
|
||||||
|
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
||||||
|
|
||||||
unpackPhase = ''
|
unpackPhase = ''
|
||||||
sh $src --keep --noexec
|
sh $src --keep --noexec
|
||||||
|
|
||||||
cd pkg/run_files
|
cd pkg/run_files
|
||||||
sh cuda-linux*.run --keep --noexec
|
sh cuda-linux*.run --keep --noexec
|
||||||
sh cuda-samples*.run --keep --noexec
|
sh cuda-samples*.run --keep --noexec
|
||||||
cd pkg
|
mv pkg ../../$(basename $src)
|
||||||
'';
|
cd ../..
|
||||||
|
rm -rf pkg
|
||||||
|
|
||||||
buildPhase = ''
|
for patch in $runPatches; do
|
||||||
chmod -R u+w .
|
sh $patch --keep --noexec
|
||||||
while IFS= read -r -d ''$'\0' i; do
|
mv pkg $(basename $patch)
|
||||||
if ! isELF "$i"; then continue; fi
|
done
|
||||||
echo "patching $i..."
|
|
||||||
if [[ ! $i =~ \.so ]]; then
|
|
||||||
patchelf \
|
|
||||||
--set-interpreter "''$(cat $NIX_CC/nix-support/dynamic-linker)" $i
|
|
||||||
fi
|
|
||||||
if [[ $i =~ libcudart ]]; then
|
|
||||||
rpath2=
|
|
||||||
else
|
|
||||||
rpath2=$rpath:$lib/lib:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64
|
|
||||||
fi
|
|
||||||
patchelf --set-rpath $rpath2 --force-rpath $i
|
|
||||||
done < <(find . -type f -print0)
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
|
cd $(basename $src)
|
||||||
perl ./install-linux.pl --prefix="$out"
|
perl ./install-linux.pl --prefix="$out"
|
||||||
|
cd ..
|
||||||
|
for patch in $runPatches; do
|
||||||
|
cd $(basename $patch)
|
||||||
|
perl ./install_patch.pl --silent --accept-eula --installdir="$out"
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
|
||||||
rm $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why?
|
rm $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why?
|
||||||
|
|
||||||
@ -117,6 +117,23 @@ let
|
|||||||
echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook
|
echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
preFixup = ''
|
||||||
|
while IFS= read -r -d ''$'\0' i; do
|
||||||
|
if ! isELF "$i"; then continue; fi
|
||||||
|
echo "patching $i..."
|
||||||
|
if [[ ! $i =~ \.so ]]; then
|
||||||
|
patchelf \
|
||||||
|
--set-interpreter "''$(cat $NIX_CC/nix-support/dynamic-linker)" $i
|
||||||
|
fi
|
||||||
|
if [[ $i =~ libcudart ]]; then
|
||||||
|
rpath2=
|
||||||
|
else
|
||||||
|
rpath2=$rpath:$lib/lib:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64
|
||||||
|
fi
|
||||||
|
patchelf --set-rpath $rpath2 --force-rpath $i
|
||||||
|
done < <(find $out $lib $doc -type f -print0)
|
||||||
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
cc = gcc;
|
cc = gcc;
|
||||||
majorVersion =
|
majorVersion =
|
||||||
@ -163,9 +180,15 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
cudatoolkit8 = common {
|
cudatoolkit8 = common {
|
||||||
version = "8.0.61";
|
version = "8.0.61.2";
|
||||||
url = "https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run";
|
url = "https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run";
|
||||||
sha256 = "1i4xrsqbad283qffvysn88w2pmxzxbbby41lw0j1113z771akv4w";
|
sha256 = "1i4xrsqbad283qffvysn88w2pmxzxbbby41lw0j1113z771akv4w";
|
||||||
|
runPatches = [
|
||||||
|
(fetchurl {
|
||||||
|
url = "https://developer.nvidia.com/compute/cuda/8.0/Prod2/patches/2/cuda_8.0.61.2_linux-run";
|
||||||
|
sha256 = "1iaz5rrsnsb1p99qiqvxn6j3ksc7ry8xlr397kqcjzxqbljbqn9d";
|
||||||
|
})
|
||||||
|
];
|
||||||
gcc = gcc5;
|
gcc = gcc5;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user