python312Packages.paddlepaddle: fix (#475961)

This commit is contained in:
Yt
2026-01-02 11:29:25 +00:00
committed by GitHub
3 changed files with 31 additions and 11 deletions
@@ -13,7 +13,7 @@
zlib,
setuptools,
cudaSupport ? config.cudaSupport or false,
cudaPackages_12_9,
cudaPackages,
addDriverRunpath,
# runtime dependencies
httpx,
@@ -23,6 +23,7 @@
decorator,
astor,
opt-einsum,
rdma-core,
safetensors,
typing-extensions,
}:
@@ -33,15 +34,20 @@ let
version = sources.version;
format = "wheel";
pyShortVersion = "cp${builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion}";
cpuOrGpu = if cudaSupport then "gpu" else "cpu";
hash =
sources."${stdenv.hostPlatform.system}"."${cpuOrGpu}"."${pyShortVersion}"
or (throw "${pname} has no sources.nix entry for '${stdenv.hostPlatform.system}.${cpuOrGpu}.${pyShortVersion}' attribute");
if cudaSupport then
sources."${stdenv.hostPlatform.system}"."gpu"."cu${
lib.replaceStrings [ "." ] [ "" ] cudaPackages.cudatoolkit.version
}"."${pyShortVersion}"
else
sources."${stdenv.hostPlatform.system}"."cpu"."${pyShortVersion}";
platform = sources."${stdenv.hostPlatform.system}".platform;
src =
if cudaSupport then
(fetchurl {
url = "https://paddle-whl.bj.bcebos.com/stable/cu129/paddlepaddle-gpu/paddlepaddle_gpu-${version}-${pyShortVersion}-${pyShortVersion}-linux_x86_64.whl";
url = "https://paddle-whl.bj.bcebos.com/stable/cu${
lib.replaceStrings [ "." ] [ "" ] cudaPackages.cudatoolkit.version
}/paddlepaddle-gpu/paddlepaddle_gpu-${version}-${pyShortVersion}-${pyShortVersion}-linux_x86_64.whl";
inherit hash;
})
else
@@ -73,6 +79,8 @@ buildPythonPackage {
]
++ lib.optionals cudaSupport [ autoPatchelfHook ];
buildInputs = lib.optionals cudaSupport [ rdma-core ];
dependencies = [
setuptools
httpx
@@ -101,7 +109,7 @@ buildPythonPackage {
(lib.getLib stdenv.cc.cc)
]
++ lib.optionals cudaSupport (
with cudaPackages_12_9;
with cudaPackages;
[
cudatoolkit.lib
cudatoolkit.out
@@ -7,8 +7,18 @@
cp313 = "sha256-xPSFWWpobqcqsN3/yeQRePRWMUqZ1FOPXRgaAVapJ/o=";
};
gpu = {
cp312 = "sha256-t2beVNEfz+JcesM5+i9BVNKKXIsI3zvz1VrTSd/79+c=";
cp313 = "sha256-0thm6aAGpqSLfJdI0MZKuJPn2e4CsNU5S19ohzkukSs=";
cu126 = {
cp312 = "sha256-gY5/W2BR9+wVcPKdi5gZiHNH/t/rCv2g76rJ0E1wRt4=";
cp313 = "sha256-CRNQl+8pRVbfJX172H2KNgsAeSiX+AYHoilMcw1pPXw=";
};
cu129 = {
cp312 = "sha256-t2beVNEfz+JcesM5+i9BVNKKXIsI3zvz1VrTSd/79+c=";
cp313 = "sha256-0thm6aAGpqSLfJdI0MZKuJPn2e4CsNU5S19ohzkukSs=";
};
cu130 = {
cp312 = "sha256-70uOCNrFH9QB9G/0e5aAufBHPthJOjoJt39uprt68sE=";
cp313 = "sha256-+aNoFQgqsrN9Jtqf0uChifIAacmbDdf8JkqjOqMsFpU=";
};
};
};
aarch64-linux = {
@@ -15,7 +15,9 @@ for system in $systems; do
done
done
for pythonPackages in "python313Packages" "python312Packages"; do
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix eval --raw --file . pkgsCuda.$pythonPackages.paddlepaddle.src.url --system x86_64-linux)))
update-source-version pkgsCuda.$pythonPackages.paddlepaddle $latestVersion $hash --file=pkgs/development/python-modules/paddlepaddle/sources.nix --system=x86_64-linux --ignore-same-version --ignore-same-hash
for cuda in "12_6" "12_9" "13_0"; do
for pythonPackages in "python313Packages" "python312Packages"; do
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix eval --raw --file . pkgsCuda.cudaPackages_${cuda}.pkgs.$pythonPackages.paddlepaddle.src.url --system x86_64-linux)))
update-source-version pkgsCuda.cudaPackages_${cuda}.pkgs.$pythonPackages.paddlepaddle $latestVersion $hash --file=pkgs/development/python-modules/paddlepaddle/sources.nix --system=x86_64-linux --ignore-same-version --ignore-same-hash
done
done