mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-03-24 02:08:51 +00:00
ci: correct rocm artifact of linux (#1269)
This commit is contained in:
parent
28ef93c0e1
commit
45ce78a3ae
55
.github/workflows/build.yml
vendored
55
.github/workflows/build.yml
vendored
@ -535,31 +535,30 @@ jobs:
|
|||||||
# Add ROCm to PATH for current session
|
# Add ROCm to PATH for current session
|
||||||
echo "/opt/rocm/bin" >> $GITHUB_PATH
|
echo "/opt/rocm/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
# Build case pattern from GPU_TARGETS
|
# Build regex pattern from ${{ env.GPU_TARGETS }} (match target as substring)
|
||||||
PATTERN=$(printf '%s' "$GPU_TARGETS" | sed 's/;/\*|\*/g')
|
TARGET_REGEX="($(printf '%s' "${{ env.GPU_TARGETS }}" | sed 's/;/|/g'))"
|
||||||
PATTERN="*${PATTERN}*"
|
|
||||||
|
|
||||||
# Remove library files for architectures we're not building for to save disk space
|
# Remove library files for architectures we're not building for to save disk space
|
||||||
echo "Cleaning up unneeded architecture files..."
|
echo "Cleaning up unneeded architecture files..."
|
||||||
cd /opt/rocm/lib/rocblas/library
|
cd /opt/rocm/lib/rocblas/library
|
||||||
# Keep only our target architectures
|
# Keep only our target architectures
|
||||||
for file in *; do
|
for file in *; do
|
||||||
case "$file" in
|
if printf '%s' "$file" | grep -q 'gfx'; then
|
||||||
$PATTERN)
|
if ! printf '%s' "$file" | grep -Eq "$TARGET_REGEX"; then
|
||||||
;;
|
echo "Removing $file" &&
|
||||||
*)
|
sudo rm -f "$file";
|
||||||
sudo rm -f "$file" ;;
|
fi
|
||||||
esac;
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
cd /opt/rocm/lib/hipblaslt/library
|
cd /opt/rocm/lib/hipblaslt/library
|
||||||
for file in *; do
|
for file in *; do
|
||||||
case "$file" in
|
if printf '%s' "$file" | grep -q 'gfx'; then
|
||||||
$PATTERN)
|
if ! printf '%s' "$file" | grep -Eq "$TARGET_REGEX"; then
|
||||||
;;
|
echo "Removing $file" &&
|
||||||
*)
|
sudo rm -f "$file";
|
||||||
sudo rm -f "$file" ;;
|
fi
|
||||||
esac;
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
@ -592,21 +591,15 @@ jobs:
|
|||||||
cp ggml/LICENSE ./build/bin/ggml.txt
|
cp ggml/LICENSE ./build/bin/ggml.txt
|
||||||
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
|
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
|
||||||
|
|
||||||
# Create directories for ROCm libraries
|
# Move ROCm runtime libraries (to avoid double space consumption)
|
||||||
mkdir -p ./build/bin/rocblas/library
|
sudo mv /opt/rocm/lib/librocsparse.so* ./build/bin/
|
||||||
mkdir -p ./build/bin/hipblaslt/library
|
sudo mv /opt/rocm/lib/libhsa-runtime64.so* ./build/bin/
|
||||||
|
sudo mv /opt/rocm/lib/libamdhip64.so* ./build/bin/
|
||||||
# Copy ROCm runtime libraries (use || true to continue if files don't exist)
|
sudo mv /opt/rocm/lib/libhipblas.so* ./build/bin/
|
||||||
cp /opt/rocm/lib/librocsparse.so* ./build/bin/ || true
|
sudo mv /opt/rocm/lib/libhipblaslt.so* ./build/bin/
|
||||||
cp /opt/rocm/lib/libhsa-runtime64.so* ./build/bin/ || true
|
sudo mv /opt/rocm/lib/librocblas.so* ./build/bin/
|
||||||
cp /opt/rocm/lib/libamdhip64.so* ./build/bin/ || true
|
sudo mv /opt/rocm/lib/rocblas/ ./build/bin/
|
||||||
cp /opt/rocm/lib/libhipblas.so* ./build/bin/ || true
|
sudo mv /opt/rocm/lib/hipblaslt/ ./build/bin/
|
||||||
cp /opt/rocm/lib/libhipblaslt.so* ./build/bin/ || true
|
|
||||||
cp /opt/rocm/lib/librocblas.so* ./build/bin/ || true
|
|
||||||
|
|
||||||
# Copy library files (already filtered to target architectures)
|
|
||||||
cp /opt/rocm/lib/rocblas/library/* ./build/bin/rocblas/library/ || true
|
|
||||||
cp /opt/rocm/lib/hipblaslt/library/* ./build/bin/hipblaslt/library/ || true
|
|
||||||
|
|
||||||
- name: Fetch system info
|
- name: Fetch system info
|
||||||
id: system-info
|
id: system-info
|
||||||
@ -622,7 +615,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cp ggml/LICENSE ./build/bin/ggml.txt
|
cp ggml/LICENSE ./build/bin/ggml.txt
|
||||||
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
|
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
|
||||||
zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-Ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}-rocm.zip ./build/bin/*
|
zip -y -r sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-Ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}-rocm.zip ./build/bin
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
|
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user