Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Fangjun Kuang
2023-08-09 20:21:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-08-09 20:21:28 +0800
Commit
6061318e3fe4a2a55e925f0b17cc334622c58d21
6061318e
1 parent
92bfee04
fix building on linux with GPU (#249)
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
197 行增加
和
2 行删除
.github/workflows/linux-gpu.yaml
cmake/onnxruntime-linux-x86_64-gpu.cmake
cmake/onnxruntime-win-x64-gpu.cmake
sherpa-onnx/csrc/CMakeLists.txt
.github/workflows/linux-gpu.yaml
0 → 100644
查看文件 @
6061318
name
:
linux-gpu
on
:
push
:
branches
:
-
master
tags
:
-
'
*'
paths
:
-
'
.github/workflows/linux-gpu.yaml'
-
'
.github/scripts/test-online-transducer.sh'
-
'
.github/scripts/test-offline-transducer.sh'
-
'
.github/scripts/test-offline-ctc.sh'
-
'
CMakeLists.txt'
-
'
cmake/**'
-
'
sherpa-onnx/csrc/*'
-
'
sherpa-onnx/c-api/*'
-
'
c-api-examples/**'
pull_request
:
branches
:
-
master
paths
:
-
'
.github/workflows/linux-gpu.yaml'
-
'
.github/scripts/test-online-transducer.sh'
-
'
.github/scripts/test-offline-transducer.sh'
-
'
.github/scripts/test-offline-ctc.sh'
-
'
CMakeLists.txt'
-
'
cmake/**'
-
'
sherpa-onnx/csrc/*'
-
'
sherpa-onnx/c-api/*'
release
:
types
:
-
published
workflow_dispatch
:
inputs
:
release
:
description
:
"
Whether
to
release"
type
:
boolean
env
:
RELEASE
:
|-
# Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}
concurrency
:
group
:
linux-gpu-${{ github.ref }}
cancel-in-progress
:
true
jobs
:
linux_gpu
:
runs-on
:
${{ matrix.os }}
name
:
${{ matrix.build_type }}
strategy
:
fail-fast
:
false
matrix
:
os
:
[
ubuntu-latest
]
build_type
:
[
Release
,
Debug
]
steps
:
-
uses
:
actions/checkout@v2
with
:
fetch-depth
:
0
-
name
:
Configure CMake
shell
:
bash
run
:
|
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=ON -DSHERPA_ONNX_ENABLE_GPU=ON ..
-
name
:
Build sherpa-onnx for ubuntu
shell
:
bash
run
:
|
cd build
make -j2
make install
ls -lh lib
ls -lh bin
-
name
:
Display dependencies of sherpa-onnx for linux
shell
:
bash
run
:
|
file build/bin/sherpa-onnx
readelf -d build/bin/sherpa-onnx
-
name
:
Test offline Whisper
shell
:
bash
run
:
|
export PATH=$PWD/build/bin:$PATH
export EXE=sherpa-onnx-offline
.github/scripts/test-offline-whisper.sh
-
name
:
Test offline CTC
shell
:
bash
run
:
|
export PATH=$PWD/build/bin:$PATH
export EXE=sherpa-onnx-offline
.github/scripts/test-offline-ctc.sh
-
name
:
Test offline transducer
shell
:
bash
run
:
|
export PATH=$PWD/build/bin:$PATH
export EXE=sherpa-onnx-offline
.github/scripts/test-offline-transducer.sh
-
name
:
Test online transducer
shell
:
bash
run
:
|
export PATH=$PWD/build/bin:$PATH
export EXE=sherpa-onnx
.github/scripts/test-online-transducer.sh
-
name
:
Test online transducer (C API)
shell
:
bash
run
:
|
export PATH=$PWD/build/bin:$PATH
export EXE=decode-file-c-api
.github/scripts/test-online-transducer.sh
-
name
:
Copy files
if
:
env.RELEASE == 'true'
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
:
env.RELEASE == 'true' && matrix.build_type == 'Release'
uses
:
svenstaro/upload-release-action@v2
with
:
file_glob
:
true
overwrite
:
true
file
:
sherpa-onnx-*linux-x64-gpu.tar.bz2
...
...
cmake/onnxruntime-linux-x86_64-gpu.cmake
查看文件 @
6061318
...
...
@@ -82,6 +82,19 @@ add_library(onnxruntime_providers_cuda SHARED IMPORTED)
set_target_properties
(
onnxruntime_providers_cuda PROPERTIES
IMPORTED_LOCATION
${
location_onnxruntime_cuda_lib
}
)
message
(
STATUS
"location_onnxruntime_cuda_lib:
${
location_onnxruntime_cuda_lib
}
"
)
# for libonnxruntime_providers_shared.so
find_library
(
location_onnxruntime_providers_shared_lib onnxruntime_providers_shared
PATHS
"
${
onnxruntime_SOURCE_DIR
}
/lib"
NO_CMAKE_SYSTEM_PATH
)
add_library
(
onnxruntime_providers_shared SHARED IMPORTED
)
set_target_properties
(
onnxruntime_providers_shared PROPERTIES
IMPORTED_LOCATION
${
location_onnxruntime_providers_shared_lib
}
)
message
(
STATUS
"location_onnxruntime_providers_shared_lib:
${
location_onnxruntime_providers_shared_lib
}
"
)
file
(
GLOB onnxruntime_lib_files
"
${
onnxruntime_SOURCE_DIR
}
/lib/libonnxruntime*"
)
message
(
STATUS
"onnxruntime lib files:
${
onnxruntime_lib_files
}
"
)
...
...
cmake/onnxruntime-win-x64-gpu.cmake
查看文件 @
6061318
...
...
@@ -82,9 +82,18 @@ file(COPY ${onnxruntime_SOURCE_DIR}/lib/onnxruntime.dll
${
CMAKE_BINARY_DIR
}
/bin/
${
CMAKE_BUILD_TYPE
}
)
# for onnxruntime_providers_cuda.dll
find_library
(
location_onnxruntime_providers_cuda_lib onnxruntime_providers_cuda
PATHS
"
${
onnxruntime_SOURCE_DIR
}
/lib"
NO_CMAKE_SYSTEM_PATH
)
message
(
STATUS
"location_onnxruntime_providers_cuda_lib:
${
location_onnxruntime_providers_cuda_lib
}
"
)
add_library
(
onnxruntime_providers_cuda SHARED IMPORTED
)
set_target_properties
(
onnxruntime_providers_cuda PROPERTIES
IMPORTED_LOCATION
${
location_onnxruntime
}
IMPORTED_LOCATION
${
location_onnxruntime
_providers_cuda_lib
}
INTERFACE_INCLUDE_DIRECTORIES
"
${
onnxruntime_SOURCE_DIR
}
/include"
)
...
...
@@ -93,7 +102,28 @@ set_property(TARGET onnxruntime_providers_cuda
IMPORTED_IMPLIB
"
${
onnxruntime_SOURCE_DIR
}
/lib/onnxruntime_providers_cuda.lib"
)
file
(
COPY
${
onnxruntime_SOURCE_DIR
}
/lib/onnxruntime_providers_cuda.dll
# for onnxruntime_providers_shared.dll
find_library
(
location_onnxruntime_providers_shared_lib onnxruntime_providers_shared
PATHS
"
${
onnxruntime_SOURCE_DIR
}
/lib"
NO_CMAKE_SYSTEM_PATH
)
message
(
STATUS
"location_onnxruntime_providers_shared_lib:
${
location_onnxruntime_providers_shared_lib
}
"
)
add_library
(
onnxruntime_providers_shared SHARED IMPORTED
)
set_target_properties
(
onnxruntime_providers_shared PROPERTIES
IMPORTED_LOCATION
${
location_onnxruntime_providers_shared_lib
}
INTERFACE_INCLUDE_DIRECTORIES
"
${
onnxruntime_SOURCE_DIR
}
/include"
)
set_property
(
TARGET onnxruntime_providers_shared
PROPERTY
IMPORTED_IMPLIB
"
${
onnxruntime_SOURCE_DIR
}
/lib/onnxruntime_providers_shared.lib"
)
file
(
COPY
${
onnxruntime_SOURCE_DIR
}
/lib/onnxruntime_providers_cuda.dll
${
onnxruntime_SOURCE_DIR
}
/lib/onnxruntime_providers_shared.dll
DESTINATION
${
CMAKE_BINARY_DIR
}
/bin/
${
CMAKE_BUILD_TYPE
}
)
...
...
sherpa-onnx/csrc/CMakeLists.txt
查看文件 @
6061318
...
...
@@ -90,6 +90,7 @@ endif()
if
(
SHERPA_ONNX_ENABLE_GPU
)
target_link_libraries
(
sherpa-onnx-core
onnxruntime_providers_cuda
onnxruntime_providers_shared
)
endif
()
...
...
请
注册
或
登录
后发表评论