Skip to content

Fixed CI build to properly install cuda and build both cuda 12 and 13 and both windows and ubuntu. #2

Fixed CI build to properly install cuda and build both cuda 12 and 13 and both windows and ubuntu.

Fixed CI build to properly install cuda and build both cuda 12 and 13 and both windows and ubuntu. #2

Workflow file for this run

name: Ubuntu
#on:
# workflow_dispatch:
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# explicit include-based build matrix, of known valid options
matrix:
include:
- os: ubuntu-24.04
cuda: "13.0.2"
gcc: 13
config: Release
build_flags:
- os: ubuntu-24.04
cuda: "none"
gcc: 13
config: Release
build_flags: "-DBARNEY_BACKEND_EMBREE=ON -DBARNEY_BACKEND_OPTIX=OFF -DBARNEY_BACKEND_CUDA=OFF"
- os: ubuntu-24.04
cuda: "13.0.2"
gcc: 13
config: Release
build_flags: "-DBARNEY_BACKEND_EMBREE=OFF -DBARNEY_BACKEND_OPTIX=OFF -DBARNEY_BACKEND_CUDA=ON"
- os: ubuntu-24.04
cuda: "12.6.0"
gcc: 13
config: Release
build_flags:
- os: ubuntu-24.04
cuda: "12.6.0"
gcc: 13
config: Debug
build_flags:
- os: ubuntu-22.04
cuda: "12.0.0"
gcc: 11
config: Release
build_flags:
env:
build_dir: "build"
steps:
- name: Checkout barney
uses: actions/checkout@v5
with:
submodules: true
- name: Install CUDA
if: contains(matrix.cuda, '.')
uses: Jimver/cuda-toolkit@master
id: cuda-toolkit
with:
cuda: ${{ matrix.cuda }}
method: 'network'
log-file-suffix: '${{matrix.os}}-gcc${{matrix.gcc}}-config${{matrix.config}}.txt'
# Specify the correct host compilers
- name: Install/Select gcc and g++
run: |
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
- name: Checkout ANARI-SDK
uses: actions/checkout@v5
with:
repository: "KhronosGroup/ANARI-SDK"
path: ${{github.workspace}}/anari_sdk
- name: CMake Configure ANARI-SDK
run: |
mkdir ${{github.workspace}}/anari_sdk/build
cd ${{github.workspace}}/anari_sdk/build
cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DBUILD_HELIDE_DEVICE=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${{matrix.config}}
- name: build ANARI-SDK
run: |
cd ${{github.workspace}}/anari_sdk/build
cmake --build . --config ${{ matrix.config }}
- name: install ANARI-SDK
run: |
cd ${{github.workspace}}/anari_sdk/build
cmake --install . --config ${{ matrix.config }}
- name: CMake Configure barney
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install ${{ matrix.build_flags }} -DCMAKE_BUILD_TYPE=${{matrix.config}}
- name: build barney
run: |
cd ${{github.workspace}}/build
cmake --build . --config ${{ matrix.config }}
- name: install barney
run: |
cd ${{github.workspace}}/build
cmake --install . --config ${{ matrix.config }}