-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add linux/windows build workflow (#10)
- Loading branch information
Showing
5 changed files
with
122 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: linux-x64-gpu | ||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/linux-x64-gpu.yml' | ||
- 'src/**' | ||
- 'CMakeLists.txt' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/linux-x64-gpu.yml' | ||
- 'src/**' | ||
- 'CMakeLists.txt' | ||
concurrency: | ||
group: linux-x64-gpu-${{ github.ref }} | ||
cancel-in-progress: true | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
cudaver: [11.8, 12.1] | ||
name: cuda-${{ matrix.cudaver }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Free disk space | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB | ||
tool-cache: false | ||
docker-images: false | ||
# All of these default to true, but feel free to set to "false" if necessary for your workflow | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
swap-storage: false | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: openmmlab/lmdeploy-builder:cuda${{ matrix.cudaver }} | ||
options: -v ${{ github.workspace }}:/work | ||
run: | | ||
cd /work | ||
source /opt/conda/bin/activate | ||
conda activate py38 | ||
mkdir build && cd build | ||
cmake .. \ | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ | ||
-DCMAKE_INSTALL_PREFIX=./install \ | ||
-DCMAKE_CUDA_FLAGS="-lineinfo" \ | ||
-DUSE_NVTX=ON \ | ||
-DBUILD_TEST=ON | ||
make -j$(nproc) && make install | ||
cd .. | ||
rm -rf build | ||
python setup.py bdist_wheel --plat-name manylinux2014_x86_64 -d /tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: windows-x64-gpu | ||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/windows-x64-gpu.yml' | ||
- 'src/**' | ||
- 'CMakeLists.txt' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/windows-x64-gpu.yml' | ||
- 'src/**' | ||
- 'CMakeLists.txt' | ||
concurrency: | ||
group: windows-x64-gpu-${{ github.ref }} | ||
cancel-in-progress: true | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
cudaver: [11.8.0, 12.1.0] | ||
name: cuda-${{ matrix.cudaver }} | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
- name: Install python packages | ||
run: | | ||
pip install -r requirements/build.txt | ||
pip install wheel | ||
- name: Setup CUDA Toolkit | ||
id: cuda-toolkit | ||
shell: pwsh | ||
run: ./builder/windows/setup_cuda.ps1 | ||
env: | ||
INPUT_CUDA_VERSION: ${{ matrix.cudaver }} | ||
- name: Build wheel | ||
run: | | ||
$env:BUILD_TEST="ON" | ||
mkdir build | ||
cd build | ||
..\builder\windows\generate.ps1 | ||
cmake --build . --config Release -- /m /v:q | ||
if (-Not $?) { | ||
echo "build failed" | ||
exit 1 | ||
} | ||
cmake --install . --config Release | ||
cd .. | ||
rm build -Force -Recurse | ||
python setup.py bdist_wheel -d build/wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters