Skip to content

Commit

Permalink
Build integrated OpenCL Linux wheel in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiannuzzi committed May 30, 2022
1 parent 6ae3076 commit dadd2d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ else # Linux
sudo apt-get install --no-install-recommends -y \
libboost1.74-dev \
ocl-icd-opencl-dev
fi
if [[ $TASK == "gpu" || $TASK == "bdist" ]] && [[ $ARCH != "aarch64" ]]; then
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
ocl-icd-libopencl1 \
clinfo
cd $BUILD_DIRECTORY # to avoid permission errors
curl -sL -o AMD-APP-SDKInstaller.tar.bz2 https://github.com/microsoft/LightGBM/releases/download/v2.0.12/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
tar -xjf AMD-APP-SDKInstaller.tar.bz2
Expand All @@ -79,6 +85,7 @@ else # Linux
sh AMD-APP-SDK*.sh --tar -xf -C $AMDAPPSDK_PATH
mv $AMDAPPSDK_PATH/lib/x86_64/sdk/* $AMDAPPSDK_PATH/lib/x86_64/
echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd
clinfo
fi
if [[ $TASK == "cuda" || $TASK == "cuda_exp" ]]; then
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
Expand Down
4 changes: 3 additions & 1 deletion .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,12 @@ elif [[ $TASK == "bdist" ]]; then
ARCH=$(uname -m)
if [[ $ARCH == "x86_64" ]]; then
PLATFORM="manylinux1_x86_64"
# Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py
export LIGHTGBM_TEST_DUAL_CPU_GPU=1
else
PLATFORM="manylinux2014_$ARCH"
fi
cd $BUILD_DIRECTORY/python-package && python setup.py bdist_wheel --plat-name=$PLATFORM --python-tag py3 || exit -1
cd $BUILD_DIRECTORY/python-package && python setup.py bdist_wheel --integrated-opencl --plat-name=$PLATFORM --python-tag py3 || exit -1
if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
cp dist/lightgbm-$LGB_VER-py3-none-$PLATFORM.whl $BUILD_ARTIFACTSTAGINGDIRECTORY
fi
Expand Down

0 comments on commit dadd2d3

Please sign in to comment.