Skip to content

Commit

Permalink
install sycl runtime for cpp tests with conda (#20)
Browse files Browse the repository at this point in the history
* use conda to install sycl runtime

* specify conda dir; specify python version

* modify env settings

---------

Co-authored-by: Dmitry Razdoburdin <>
  • Loading branch information
razdoburdin authored Nov 22, 2023
1 parent 5046112 commit 18d77c6
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,39 +70,40 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8"]
steps:
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0
with:
submodules: 'true'
- name: Install SYCL runtime
run: |
sudo apt-get update
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install -y intel-dpcpp-cpp-compiler-2023.2.1
source /opt/intel/oneapi/compiler/latest/env/vars.sh
source /opt/intel/oneapi/tbb/latest/env/vars.sh
icpx --version
sycl-ls
- uses: mamba-org/provision-with-micromamba@f347426e5745fe3dfc13ec5baf20496990d0281f # v14
with:
cache-downloads: true
cache-env: true
environment-name: linux_sycl_test
environment-file: tests/ci_build/conda_env/linux_sycl_test.yml

- name: Display Conda env
run: |
conda info
conda list
- name: Build and install XGBoost
shell: bash -l {0}
run: |
source /opt/intel/oneapi/compiler/latest/env/vars.sh
source /opt/intel/oneapi/tbb/latest/env/vars.sh
mkdir build
cd build
cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON
# modify variable to build xgboost with g++ and plugin with icxp
export CXX=g++
export CC=gcc
export CXXFLAGS=${CXXFLAGS/' -isystem '$CONDA_PREFIX'/include'}
export DEBUG_CXXFLAGS=${DEBUG_CXXFLAGS/' -isystem '$CONDA_PREFIX'/include'}
export CPPFLAGS=${CPPFLAGS/' -isystem '$CONDA_PREFIX'/include'}
export DEBUG_CPPFLAGS=${DEBUG_CPPFLAGS/' -isystem '$CONDA_PREFIX'/include'}
cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
make -j$(nproc)
- name: Run gtest binary
run: |
source /opt/intel/oneapi/compiler/latest/env/vars.sh
source /opt/intel/oneapi/tbb/latest/env/vars.sh
cd build
./testxgboost --gtest_filter=Sycl*
Expand Down

0 comments on commit 18d77c6

Please sign in to comment.