Skip to content

Commit

Permalink
add linux build to jenkins, microsoft#1
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonswope committed Aug 28, 2024
1 parent 32b3d99 commit b21803e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 15 deletions.
45 changes: 32 additions & 13 deletions bfx/build_linux.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
source scl_source enable devtoolset-9
PATH=/home/buildpc/ml/deps/cmake-3.26.1-linux-x86_64/bin:$PATH
#do this before the script??
#conda init bash
#conda activate
#!/bin/bash
set -a

DIST_NAME=$1

echo starting onnxruntime on build: $DIST_NAME

rm -rf build
mkdir build

cd build
# fetch CUDA dependencies from BinaryArtifacts
BINARY_ARTIFACTS="mescola:Boris FX/Engineering/BinaryArtifacts"

CUDA_SDK_NAME='cuda_11.8.0_520.61.05_linux'
rclone copy ${BINARY_ARTIFACTS}/${CUDA_SDK_NAME}.tgz .
tar -xf ${CUDA_SDK_NAME}.tgz
CUDA_HOME=$(pwd)/cuda_sdk

CUDNN_NAME='cudnn-linux-x86_64-8.9.4.25_cuda11-archive'
rclone copy ${BINARY_ARTIFACTS}/${CUDNN_NAME}.txz .
tar -xzf ${CUDNN_NAME}.txz
CUDNN_HOME=$(pwd)/cudnn
cd ..

eval "$(conda shell.bash hook)"
conda activate base

./build.sh --config Release \
--build_shared_lib \
--use_cuda \
--cuda_home /home/buildpc/ml/sdk_deps/cuda_sdk_dir \
--cudnn_home /home/buildpc/ml/sdk_deps/cudnn_dir \
--cuda_home $CUDA_HOME \
--cudnn_home $CUDNN_HOME \
--skip_tests \
--cmake_extra_defines \
onnxruntime_BUILD_UNIT_TESTS=OFF
Expand All @@ -21,11 +44,7 @@ cp build/Linux/Release/libonnxruntime_providers_shared.so build/dist_release/lib
cp build/Linux/Release/libonnxruntime_providers_cuda.so build/dist_release/lib
cp -r include build/dist_release/.

# now, convert to distributable!
dist_name=onnxruntime-linux-x64-1.18.1-5eeac2d-cu118
mv build/dist_release build/$dist_name

# zip it up!
mv build/dist_release build/$DIST_NAME
cd build
zip -r $dist_name.zip $(basename $dist_name)
zip -r $DIST_NAME.zip $(basename $DIST_NAME)
cd ..
11 changes: 11 additions & 0 deletions bfx/build_linux_jenkins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -a

export PATH=/home/buildpc/ml/deps/cmake-3.26.1-linux-x86_64/bin:$PATH

source scl_source enable devtoolset-9

BUILD_ID=$(date '+%Y-%m-%d')_$(git rev-parse --short HEAD)_${BUILD_NUMBER}

./bfx/build_linux.sh
"${WORKSPACE}/script/build_sdk_linux.sh" $build_id
4 changes: 2 additions & 2 deletions bfx/build_win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Push-Location build
$CUDA_SDK_NAME='cuda-sdk-win-v11.8'
rclone copy ($BINARY_ARTIFACTS + '/' + $CUDA_SDK_NAME + '.zip') .
tar -xzf ($CUDA_SDK_NAME + '.zip')
$CUDA_HOME = "$(Get-Location)\build\${CUDA_SDK_NAME}"
$CUDA_HOME = "$(Get-Location)\${CUDA_SDK_NAME}"

$CUDNN_NAME='cudnn-windows-x86_64-8.9.1.23_cuda11-archive'
rclone copy ($BINARY_ARTIFACTS + '/' + $CUDNN_NAME + '.zip') .
tar -xzf ($CUDNN_NAME + '.zip')
$CUDNN_HOME = "$(Get-Location)\build\${CUDNN_NAME}"
$CUDNN_HOME = "$(Get-Location)\${CUDNN_NAME}"
Pop-Location

conda activate base; CheckForErrors;
Expand Down

0 comments on commit b21803e

Please sign in to comment.