Skip to content

Documentation update for 0.23.2 #12

Documentation update for 0.23.2

Documentation update for 0.23.2 #12

Workflow file for this run

# This file is part of mfaktc.
# Copyright (c) 2025 NStorm (https://github.com/N-Storm)
# Copyright (c) 2009-2011 Oliver Weihe ([email protected])
#
# mfaktc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# mfaktc is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mfaktc. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: mfaktc CI
on:
push:
paths-ignore:
- '**/*.txt'
- 'COPYING'
- '.gitignore'
pull_request:
paths-ignore:
- '**/*.txt'
- 'COPYING'
- '.gitignore'
types:
- 'opened'
- 'reopened'
- 'synchronize'
- 'ready_for_review'
workflow_dispatch:
jobs:
# Begin job "build-linux"
build-linux:
runs-on: ubuntu-latest
strategy:
# If set to true, all jobs within the same matrix (such as Linux or
# Windows builds) will be aborted at the same time if any one job fails.
fail-fast: false
matrix:
sys:
# Specified version combination must exist as CUDA container image from Nvidia: nvcr.io/nvidia/cuda:${{ matrix.sys.cuda_version }}-devel-${{ matrix.sys.ct_os }}
# Available versions can be found here: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda/tags (note that only Ubuntu distros are supported by this action)
- { cuda_version: '12.8.0', ct_os: 'ubuntu24.04' }
- { cuda_version: '12.6.3', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.6.2', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.6.1', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.6.0', ct_os: 'ubuntu22.04' }
- { cuda_version: '12.5.1', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.5.0', ct_os: 'ubuntu22.04' }
- { cuda_version: '12.4.1', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.4.0', ct_os: 'ubuntu22.04' }
- { cuda_version: '12.3.2', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.3.1', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.3.0', ct_os: 'ubuntu22.04' }
- { cuda_version: '12.2.2', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.2.0', ct_os: 'ubuntu22.04' }
- { cuda_version: '12.1.1', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.1.0', ct_os: 'ubuntu22.04' }
- { cuda_version: '12.0.1', ct_os: 'ubuntu22.04' }
# - { cuda_version: '12.0.0', ct_os: 'ubuntu22.04' }
- { cuda_version: '11.8.0', ct_os: 'ubuntu22.04' }
- { cuda_version: '11.7.1', ct_os: 'ubuntu22.04' }
# - { cuda_version: '11.7.0', ct_os: 'ubuntu22.04' }
- { cuda_version: '11.6.2', ct_os: 'ubuntu20.04' }
# - { cuda_version: '11.6.1', ct_os: 'ubuntu20.04' }
# - { cuda_version: '11.6.0', ct_os: 'ubuntu20.04' }
- { cuda_version: '11.5.2', ct_os: 'ubuntu20.04' }
# - { cuda_version: '11.5.1', ct_os: 'ubuntu20.04' }
# - { cuda_version: '11.5.0', ct_os: 'ubuntu20.04' }
- { cuda_version: '11.4.3', ct_os: 'ubuntu20.04' }
- { cuda_version: '11.3.1', ct_os: 'ubuntu20.04' }
- { cuda_version: '11.2.2', ct_os: 'ubuntu20.04' }
- { cuda_version: '11.1.1', ct_os: 'ubuntu20.04' }
- { cuda_version: '11.0.3', ct_os: 'ubuntu20.04' }
- { cuda_version: '10.2', ct_os: 'ubuntu18.04' }
- { cuda_version: '9.2', ct_os: 'ubuntu18.04' }
- { cuda_version: '8.0', ct_os: 'ubuntu16.04' }
env:
# We can't use GitHub direct container support on old Ubuntu versions,
# because actions will fail due to an old glibc version.
# A workaround is to use 'docker exec' to run build-related actions in
# a separately launched Docker container, while generic actions will run
# on the host runner.
CONTAINER: "nvcr.io/nvidia/cuda:${{ matrix.sys.cuda_version }}-devel-${{ matrix.sys.ct_os }}"
steps:
- name: Start Docker container
run: |
docker pull $CONTAINER
docker run --name build-container -d -v ${{ github.workspace }}:/workspace $CONTAINER tail -f /dev/null
- name: Update GPG keys for CUDA repo on Ubuntu 16.04
if: matrix.sys.ct_os == 'ubuntu16.04'
env:
SCRIPT: apt-key add /workspace/3bf863cc.pub
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub
docker exec build-container bash -c "$SCRIPT"
- name: Update and install dependencies inside container
id: packages
env:
SCRIPT: |
apt-get update
apt-get -y full-upgrade
apt-get install -y build-essential curl git make python3 sudo unzip wget zip
run: docker exec build-container bash -c "$SCRIPT"
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Prepare sources and gather info
id: prepare
env:
SCRIPT: |
cd /workspace
git config --global --add safe.directory /workspace
bash .github/workflows/scripts/build_helper.sh ${{ matrix.sys.cuda_version }}
run: |
docker exec build-container bash -c "$SCRIPT"
cat .github/workflows/scripts/build_helper.sh.out >> $GITHUB_OUTPUT
- name: Build from sources
env:
SCRIPT: cd /workspace/src && make -j$(nproc)
run: docker exec build-container bash -c "$SCRIPT"
- name: Prepare ZIP archive with description
env:
SCRIPT: |
cd /workspace
zip -9 -j ${{ steps.prepare.outputs.BASE_NAME }}.zip *
echo "[${{ steps.prepare.outputs.BASE_NAME }}.zip](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/${{ steps.prepare.outputs.BASE_NAME }}.zip) | \
${{ matrix.sys.cuda_version }} | ${{ steps.prepare.outputs.CC_MIN }}-${{ steps.prepare.outputs.CC_MAX }} | ${{ steps.prepare.outputs.OS_VER }} | \
${{ steps.prepare.outputs.COMPILER_VER }} | ${{ steps.prepare.outputs.NVCC_VER }}" > ${{ steps.prepare.outputs.BASE_NAME }}.txt
run: docker exec build-container bash -c "$SCRIPT"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.prepare.outputs.BASE_NAME }}
path: ${{ steps.prepare.outputs.BASE_NAME }}.*
# End job "build-linux"
# Begin job "build-win"
build-win:
runs-on: ${{ matrix.sys.os }}
strategy:
# If set to true, all jobs within the same matrix (such as Linux or
# Windows builds) will be aborted at the same time if any one job fails.
fail-fast: false
matrix:
# Available versions can be viewed at the Jimver/cuda-toolkit action sources:
# https://github.com/Jimver/cuda-toolkit/blob/v0.2.21/src/links/windows-links.ts
sys:
- { cuda_version: '12.8.0', os: 'windows-2022' }
- { cuda_version: '12.6.3', os: 'windows-2022' }
- { cuda_version: '12.5.1', os: 'windows-2022' }
- { cuda_version: '12.4.1', os: 'windows-2022' }
- { cuda_version: '12.3.2', os: 'windows-2022' }
- { cuda_version: '12.2.2', os: 'windows-2022' }
- { cuda_version: '12.1.1', os: 'windows-2022' }
- { cuda_version: '12.0.1', os: 'windows-2022' }
- { cuda_version: '11.8.0', os: 'windows-2022' }
- { cuda_version: '11.7.1', os: 'windows-2022' }
- { cuda_version: '11.6.2', os: 'windows-2022' }
- { cuda_version: '11.5.2', os: 'windows-2022' }
- { cuda_version: '11.4.4', os: 'windows-2022' }
- { cuda_version: '11.3.1', os: 'windows-2022' }
- { cuda_version: '11.2.2', os: 'windows-2019' }
- { cuda_version: '11.1.1', os: 'windows-2019' }
- { cuda_version: '11.0.1', os: 'windows-2019' }
- { cuda_version: '10.0.130', os: 'windows-2019' }
- { cuda_version: '9.2.148', os: 'windows-2019' }
- { cuda_version: '8.0.61', os: 'windows-2019' }
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Install CUDA Toolkit
id: cuda-toolkit
uses: Jimver/[email protected]
with:
cuda: ${{ matrix.sys.cuda_version }}
sub-packages: ${{ startsWith(matrix.sys.cuda_version, '8.') && '[]' || '[ "nvcc", "cudart" ]' }}
use-local-cache: false
- name: Configure path to CUDA
shell: powershell
run: |
[System.Environment]::SetEnvironmentVariable('PATH', "$env:CUDA_PATH\bin;$env:PATH", 'User')
- name: Prepare sources and gather info
id: prepare
shell: bash
run: |
bash .github/workflows/scripts/build_helper.sh ${{ matrix.sys.cuda_version }}
cat .github/workflows/scripts/build_helper.sh.out >> $GITHUB_OUTPUT
- name: Build from sources with MSVC 2022 using PowerShell
if: ${{ matrix.sys.os == 'windows-2022' }}
shell: powershell
# MSVC 2022 on the Windows 2022 Server runner has a PowerShell script to
# launch a development shell.
run: |
& 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1' -Arch amd64 -HostArch amd64
cd "${{ github.workspace }}\src"
Copy-Item mfaktc.ini ..
make SHELL="powershell.exe" -f Makefile.win
- name: Build from sources with MSVC 2019 using cmd.exe
if: ${{ matrix.sys.os == 'windows-2019' }}
shell: cmd
# MSVC 2019 has a similar script on the Windows 2019 Server runner, but
# that only supports a 32-bit (x86) environment and doesn't allow
# setting the architecture.
# So we have to run a batch file to configure a 64-bit environment and
# then launch PowerShell from make afterwards. PowerShell is much better
# at handling long paths and quotes when invoked from make.
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64 ${{ env.VCVARS_VER }} & cd src & copy mfaktc.ini .. & make SHELL="powershell.exe" -f Makefile.win
env:
# -vcvars_ver=14.0 enables the MSVC 14.0 (2015) build environment -
# this is an MSVC 2019 component and not a complete MSVC instance.
VCVARS_VER: ${{ steps.prepare.outputs.CUDA_VER_MAJOR <= 10 && '-vcvars_ver=14.0' || '' }}
- name: Prepare build archive with description
shell: bash
run: |
choco install -y --no-progress zip
zip -9 -j "${{ steps.prepare.outputs.BASE_NAME }}.zip" *
echo "[${{ steps.prepare.outputs.BASE_NAME }}.zip](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/${{ steps.prepare.outputs.BASE_NAME }}.zip) | \
${{ matrix.sys.cuda_version }} | ${{ steps.prepare.outputs.CC_MIN }}-${{ steps.prepare.outputs.CC_MAX }} | ${{ steps.prepare.outputs.OS_VER }} | \
${{ steps.prepare.outputs.COMPILER_VER }} | ${{ steps.prepare.outputs.NVCC_VER }}" > ${{ steps.prepare.outputs.BASE_NAME }}.txt
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.prepare.outputs.BASE_NAME }}
path: ${{ steps.prepare.outputs.BASE_NAME }}.*
# End job "build-win"
# Begin job "upload-release"
upload-release:
# This job expects the Git tag name to begin with the version specified by
# MFAKTC_VERSION in params.h
# Otherwise, the job will fail because there is a version conflict between Git
# and params.h that must be resolved.
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/')
needs: [ build-linux, build-win ]
runs-on: ubuntu-latest
permissions:
contents: write
env:
base_name: mfaktc-${{ github.ref_name }}*-cuda*/mfaktc-${{ github.ref_name }}*-cuda*
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Prepare asset list and release notes
id: makeinfo
run: |
if ! compgen -G "${{ env.base_name }}.txt" > /dev/null 2>&1; then
echo "::error ::Could not find release notes with mask ${{ env.base_name }}.txt"
echo "::error ::Ensure the Git tag name begins with the version specified by MFAKTC_VERSION in src/params.h"
exit 1
fi
{
echo "Binary releases (automated builds) as follows."
echo "Compute Capability (CC) in the table means minimum and maximum versions supported."
echo "CC versions are listed without the separator. For example, '90' means devices with compute capability 9.0 can run that build."
echo
echo "File | CUDA version | Compute Capability | Build OS | Compiler version | NVCC version"
echo "--- | --- | --- | --- | --- | ---"
sort -Vr ${{ env.base_name }}.txt
} > RELEASE_NOTES.txt
{
echo 'RELEASE_FILES<<EOF'
printf '%s\n' ${{ env.base_name }}.zip | sort -Vr
echo 'EOF'
} > $GITHUB_OUTPUT
- name: Create and upload release package
uses: softprops/[email protected]
with:
fail_on_unmatched_files: false
files: |
${{ steps.makeinfo.outputs.RELEASE_FILES }}
preserve_order: true
generate_release_notes: true
body_path: RELEASE_NOTES.txt
make_latest: true
# End job "upload-release"