Use manylinux_2_28_x86_64 to build linux gpu for sherpa-onnx (#2123)
This commit is contained in:
134
.github/workflows/linux-gpu.yaml
vendored
134
.github/workflows/linux-gpu.yaml
vendored
@@ -56,44 +56,105 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: ccache
|
- name: Build sherpa-onnx
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
uses: addnab/docker-run-action@v3
|
||||||
with:
|
with:
|
||||||
key: ${{ matrix.os }}-${{ matrix.build_type }}-gpu
|
image: quay.io/pypa/manylinux_2_28_x86_64
|
||||||
|
options: |
|
||||||
|
--volume ${{ github.workspace }}/:/home/runner/work/sherpa-onnx/sherpa-onnx
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
uname -a
|
||||||
|
gcc --version
|
||||||
|
cmake --version
|
||||||
|
cat /etc/*release
|
||||||
|
id
|
||||||
|
pwd
|
||||||
|
|
||||||
- name: Configure CMake
|
cd /home/runner/work/sherpa-onnx/sherpa-onnx
|
||||||
|
|
||||||
|
git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib
|
||||||
|
pushd alsa-lib
|
||||||
|
./gitcompile
|
||||||
|
popd
|
||||||
|
|
||||||
|
export CPLUS_INCLUDE_PATH=$PWD/alsa-lib/include:$CPLUS_INCLUDE_PATH
|
||||||
|
export SHERPA_ONNX_ALSA_LIB_DIR=$PWD/alsa-lib/src/.libs
|
||||||
|
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
|
||||||
|
cmake \
|
||||||
|
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||||
|
-D CMAKE_INSTALL_PREFIX=./install \
|
||||||
|
-D BUILD_SHARED_LIBS=ON \
|
||||||
|
-D SHERPA_ONNX_ENABLE_GPU=ON \
|
||||||
|
..
|
||||||
|
|
||||||
|
make -j2
|
||||||
|
make install
|
||||||
|
|
||||||
|
ls -lh lib
|
||||||
|
ls -lh bin
|
||||||
|
|
||||||
|
echo "----"
|
||||||
|
ls -lh install/lib
|
||||||
|
|
||||||
|
echo "----"
|
||||||
|
ls -lh install/bin
|
||||||
|
|
||||||
|
- name: Display dependencies of sherpa-onnx for linux
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
du -h -d1 .
|
||||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
sudo chown -R $USER ./build
|
||||||
cmake --version
|
ls -lh build/bin
|
||||||
|
ls -lh build/_deps/onnxruntime-src/lib/
|
||||||
|
|
||||||
mkdir build
|
echo "strip"
|
||||||
cd build
|
strip build/bin/*
|
||||||
cmake \
|
echo "after strip"
|
||||||
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
ls -lh build/bin
|
||||||
-D CMAKE_INSTALL_PREFIX=./install \
|
|
||||||
-D BUILD_SHARED_LIBS=ON \
|
|
||||||
-D SHERPA_ONNX_ENABLE_GPU=ON \
|
|
||||||
..
|
|
||||||
|
|
||||||
- name: Build sherpa-onnx for ubuntu
|
file build/bin/sherpa-onnx
|
||||||
|
file build/bin/sherpa-onnx
|
||||||
|
ls -lh build/bin/sherpa-onnx
|
||||||
|
readelf -d build/bin/sherpa-onnx
|
||||||
|
|
||||||
|
rm -fv build/install/include/cargs.h
|
||||||
|
rm -fv build/install/lib/cargs.h
|
||||||
|
rm -fv build/install/lib/libcargs.so
|
||||||
|
rm -rfv build/install/lib/pkgconfig
|
||||||
|
|
||||||
|
strings build/install/lib/*.so | grep "^GLIBC_"
|
||||||
|
|
||||||
|
- name: Copy files
|
||||||
|
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||||
|
|
||||||
cd build
|
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-x64-gpu
|
||||||
make -j2
|
mkdir $dst
|
||||||
make install
|
|
||||||
|
|
||||||
ls -lh lib
|
cp -a build/install/bin $dst/
|
||||||
ls -lh bin
|
cp -a build/install/lib $dst/
|
||||||
|
cp -a build/install/include $dst/
|
||||||
|
|
||||||
echo "----"
|
tree $dst
|
||||||
ls -lh install/lib
|
|
||||||
|
|
||||||
echo "----"
|
tar cjvf ${dst}.tar.bz2 $dst
|
||||||
ls -lh install/bin
|
|
||||||
|
- name: Release pre-compiled binaries and libs for linux x64
|
||||||
|
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
file_glob: true
|
||||||
|
overwrite: true
|
||||||
|
file: sherpa-onnx-*linux-x64-gpu.tar.bz2
|
||||||
|
# repo_name: k2-fsa/sherpa-onnx
|
||||||
|
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||||
|
# tag: v1.11.3
|
||||||
|
|
||||||
- name: Display dependencies of sherpa-onnx for linux
|
- name: Display dependencies of sherpa-onnx for linux
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -174,27 +235,6 @@ jobs:
|
|||||||
|
|
||||||
.github/scripts/test-online-transducer.sh
|
.github/scripts/test-online-transducer.sh
|
||||||
|
|
||||||
- name: Copy files
|
|
||||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
|
||||||
|
|
||||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-x64-gpu
|
|
||||||
mkdir $dst
|
|
||||||
|
|
||||||
cp -a build/install/bin $dst/
|
|
||||||
cp -a build/install/lib $dst/
|
|
||||||
cp -a build/install/include $dst/
|
|
||||||
|
|
||||||
tree $dst
|
|
||||||
|
|
||||||
tar cjvf ${dst}.tar.bz2 $dst
|
|
||||||
|
|
||||||
- name: Release pre-compiled binaries and libs for linux x64
|
|
||||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
with:
|
|
||||||
file_glob: true
|
|
||||||
overwrite: true
|
|
||||||
file: sherpa-onnx-*linux-x64-gpu.tar.bz2
|
|
||||||
|
|||||||
Reference in New Issue
Block a user