Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 95 additions & 6 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,99 @@ on:
permissions:
contents: read

env:
CUDA_VERSION: "12.9.1"
CUDA_ARCHS: "60;61;75;86;89"
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"

jobs:
build-windows:
name: Windows Win64
runs-on: windows-2022

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Install CUDA Toolkit
# v0.2.24 only knows about CUDA 12.9.0. Updating the action keeps our requested
# toolkit line at 12.9.1 instead of silently downgrading it just to satisfy the installer.
uses: Jimver/cuda-toolkit@v0.2.29
with:
cuda: ${{ env.CUDA_VERSION }}
method: network

- name: Verify CUDA toolchain
shell: pwsh
run: |
& "$env:CUDA_PATH\bin\nvcc.exe" --version
cmake --version
ninja --version

- name: Enter MSVC developer environment
shell: pwsh
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$installationPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not $installationPath) {
throw "Could not locate a Visual Studio installation with C++ tools."
}

$vsDevCmd = Join-Path $installationPath "Common7\Tools\VsDevCmd.bat"
if (-not (Test-Path $vsDevCmd)) {
throw "Could not locate VsDevCmd.bat at $vsDevCmd"
}

cmd /c "`"$vsDevCmd`" -arch=amd64 -host_arch=amd64 && set" |
ForEach-Object {
if ($_ -match '^(.*?)=(.*)$') {
"$($matches[1])=$($matches[2])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
}

- name: Configure
shell: pwsh
run: |
cmake -S . -B build/windows-win64 -G Ninja `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DIBKEYER_ENABLE_CUDA=ON `
-DCMAKE_CUDA_ARCHITECTURES="${env:CUDA_ARCHS}" `
-DCMAKE_CUDA_COMPILER="$env:CUDA_PATH\bin\nvcc.exe" `
-DCMAKE_CUDA_FLAGS=-allow-unsupported-compiler

- name: Build
shell: pwsh
run: cmake --build build/windows-win64 --config RelWithDebInfo --parallel

- name: Verify bundle
shell: pwsh
run: |
if (-not (Test-Path "IBKeymaster/IBKeyer.ofx.bundle/Contents/Win64/IBKeyer.ofx")) {
throw "Windows OFX bundle was not produced."
}

- name: Stage artifact
shell: pwsh
run: |
Remove-Item -Recurse -Force artifacts/windows-win64 -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path artifacts/windows-win64/IBKeyer-Win64-portable | Out-Null
Copy-Item -Recurse "IBKeymaster/IBKeyer.ofx.bundle" "artifacts/windows-win64/IBKeyer-Win64-portable/"

- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: IBKeyer-Win64
path: artifacts/windows-win64/IBKeyer-Win64-portable
if-no-files-found: error
retention-days: 14

build-macos-universal:
name: macOS universal
runs-on: macos-14

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Configure
shell: bash
Expand Down Expand Up @@ -64,7 +149,7 @@ jobs:
artifacts/macos-universal/IBKeyer-macos-universal-portable/

- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: IBKeyer-macos-universal
path: artifacts/macos-universal/IBKeyer-macos-universal-portable
Expand All @@ -77,11 +162,11 @@ jobs:
container:
# GitHub's standard Linux runners do not guarantee an nvcc toolchain. Building inside an
# NVIDIA CUDA devel image keeps the Linux artifact reproducible without needing a GPU.
image: nvidia/cuda:12.4.1-devel-ubuntu22.04
image: nvidia/cuda:12.9.1-devel-ubuntu22.04

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Install build dependencies
shell: bash
Expand All @@ -96,7 +181,11 @@ jobs:

- name: Configure
shell: bash
run: cmake -S . -B build/linux-x86_64 -DCMAKE_BUILD_TYPE=RelWithDebInfo
run: |
cmake -S . -B build/linux-x86_64 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DIBKEYER_ENABLE_CUDA=ON \
-DCMAKE_CUDA_ARCHITECTURES="${CUDA_ARCHS}"

- name: Build
shell: bash
Expand All @@ -115,7 +204,7 @@ jobs:
artifacts/linux-x86_64/IBKeyer-linux-x86_64-portable/IBKeyer.ofx.bundle/Contents/Linux-x86-64/

- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: IBKeyer-linux-x86_64
path: artifacts/linux-x86_64/IBKeyer-linux-x86_64-portable
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ if(IBKEYER_ENABLE_CUDA AND (WIN32 OR (UNIX AND NOT APPLE)))
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES 75 86 89)
# Pascal support needs sm_60/sm_61 in the fatbin, otherwise a "CUDA-enabled" build can still
# fail to launch on older but still very usable NVIDIA cards. Keeping this default aligned with
# CI artifacts avoids the trap where GitHub builds support Pascal but local builds silently do not.
set(CMAKE_CUDA_ARCHITECTURES 60 61 75 86 89)
endif()
if(WIN32)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -allow-unsupported-compiler")
Expand Down
19 changes: 10 additions & 9 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
{
"name": "windows-vs",
"displayName": "Windows VC + Ninja",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/windows-vc",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"IBKEYER_ENABLE_CUDA": "ON",
"CMAKE_CUDA_ARCHITECTURES": "75;86;89",
"CMAKE_CUDA_COMPILER": "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.1/bin/nvcc.exe",
"CMAKE_CUDA_FLAGS": "-allow-unsupported-compiler",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/windows-vc",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"IBKEYER_ENABLE_CUDA": "ON",
"CMAKE_CUDA_ARCHITECTURES": "60;61;75;86;89",
"CMAKE_CUDA_COMPILER": "$env{CUDA_PATH}/bin/nvcc.exe",
"CMAKE_CUDA_FLAGS": "-allow-unsupported-compiler",
"CMAKE_MAKE_PROGRAM": "C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe"
}
},
Expand All @@ -27,7 +27,8 @@
"binaryDir": "${sourceDir}/build/linux-ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"IBKEYER_ENABLE_CUDA": "ON"
"IBKEYER_ENABLE_CUDA": "ON",
"CMAKE_CUDA_ARCHITECTURES": "60;61;75;86;89"
}
},
{
Expand Down
Loading
Loading