Skip to content

Commit

Permalink
Enable integrated OpenCL Linux wheel arm64 testing in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiannuzzi committed Jun 14, 2022
1 parent 6a08e4f commit 7b11941
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
34 changes: 24 additions & 10 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,36 @@ else # Linux
libboost1.74-dev \
ocl-icd-opencl-dev
fi
if [[ $TASK == "gpu" || $TASK == "bdist" ]] && [[ $(uname -m) == "x86_64" ]]; then
sudo apt-get update
if [[ $TASK == "gpu" || $TASK == "bdist" ]]; then
if [[ $IN_UBUNTU_LATEST_CONTAINER == "true" ]]; then
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
pocl-opencl-icd
else
sudo apt-get install --no-install-recommends -y \
libhwloc-dev \
libtinfo-dev \
ocl-icd-dev \
pkg-config \
zlib1g-dev
if [[ $ARCH == "aarch64" ]]; then
yum install -y \
epel-release \
gcc-c++ \
hwloc-devel
yum install -y \
llvm-toolset-7.0-clang-devel \
llvm-toolset-7.0-llvm-devel \
ocl-icd-devel
pocl_extra_flags="-DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_C_FLAGS=-std=gnu99 -DLLC_HOST_CPU=generic"
else
apt-get update
apt-get install --no-install-recommends -y \
libhwloc-dev \
libtinfo-dev \
ocl-icd-dev \
pkg-config \
zlib1g-dev
pocl_extra_flags="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DSTATIC_LLVM=ON"
fi
git clone --depth 1 --branch v1.8 https://github.com/pocl/pocl.git
cmake -B pocl/build -S pocl -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DPOCL_INSTALL_ICD_VENDORDIR=/etc/OpenCL/vendors -DPOCL_DEBUG_MESSAGES=OFF -DSTATIC_LLVM=ON -DINSTALL_OPENCL_HEADERS=OFF -DENABLE_SPIR=OFF -DENABLE_POCLCC=OFF -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF
cmake -B pocl/build -S pocl -DCMAKE_BUILD_TYPE=release -DPOCL_INSTALL_ICD_VENDORDIR=/etc/OpenCL/vendors -DPOCL_DEBUG_MESSAGES=OFF -DINSTALL_OPENCL_HEADERS=OFF -DENABLE_SPIR=OFF -DENABLE_POCLCC=OFF -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF $pocl_extra_flags
cmake --build pocl/build -j4
sudo cmake --install pocl/build
cmake --install pocl/build
fi
fi
if [[ $TASK == "cuda" || $TASK == "cuda_exp" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ 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 --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
# Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py
export LIGHTGBM_TEST_DUAL_CPU_GPU=1
fi
pip install --user $BUILD_DIRECTORY/python-package/dist/*.whl || exit -1
pytest $BUILD_DIRECTORY/tests || exit -1
Expand Down
3 changes: 2 additions & 1 deletion .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ jobs:
EOF
cat > docker-script.sh <<EOF
export CONDA=\$HOME/miniforge
export PATH=\$CONDA/bin:\$PATH
export PATH=\$CONDA/bin:/opt/rh/llvm-toolset-7.0/root/usr/bin:\$PATH
export LD_LIBRARY_PATH=/opt/rh/llvm-toolset-7.0/root/usr/lib64:\$LD_LIBRARY_PATH
$ROOT_DOCKER_FOLDER/.ci/setup.sh || exit -1
$ROOT_DOCKER_FOLDER/.ci/test.sh || exit -1
EOF
Expand Down

0 comments on commit 7b11941

Please sign in to comment.