Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .github/actions/build-plugin/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
acceleration:
description: 'Enable acceleration'
required: false
default: 'cpu'
default: 'generic'
codesign:
description: 'Enable codesigning (macOS only)'
required: false
Expand Down Expand Up @@ -59,6 +59,8 @@ runs:
if: runner.os == 'Linux'
shell: zsh --no-rcs --errexit --pipefail {0}
working-directory: ${{ inputs.workingDirectory }}
env:
ACCELERATION: ${{ inputs.acceleration }}
run: |
: Run Ubuntu Build

Expand Down
4 changes: 3 additions & 1 deletion .github/actions/package-plugin/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
acceleration:
description: 'Enable acceleration'
required: false
default: 'cpu'
default: 'generic'
codesign:
description: 'Enable codesigning (macOS only)'
required: false
Expand Down Expand Up @@ -88,6 +88,8 @@ runs:
if: runner.os == 'Linux'
shell: zsh --no-rcs --errexit --pipefail {0}
working-directory: ${{ inputs.workingDirectory }}
env:
ACCELERATION: ${{ inputs.acceleration }}
run: |
: Run Ubuntu Packaging
package_args=(
Expand Down
10 changes: 8 additions & 2 deletions .github/scripts/.Aptfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ package 'cmake'
package 'ccache'
package 'git'
package 'jq'
package 'libcurl4-openssl-dev'
package 'libicu-dev'
package 'libopenblas-dev'
package 'libopenblas-openmp-dev'
package 'libsimde-dev'
package 'ninja-build', bin: 'ninja'
package 'nvidia-opencl-dev'
package 'ocl-icd-opencl-dev'
package 'opencl-headers'
package 'pkg-config'
package 'libopenblas-dev'
package 'libavformat-dev'
2 changes: 1 addition & 1 deletion .github/scripts/.package.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ ${_usage_host:-}"
popd
} else {
log_group "Archiving ${product_name}..."
local output_name="${product_name}-${product_version}-${target##*-}-linux-gnu"
local output_name="${product_name}-${product_version}-${target##*-}linux-gnu-${+ACCELERATION}"
local _tarflags='cJf'
if (( _loglevel > 1 || ${+CI} )) _tarflags="v${_tarflags}"

Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/Package-Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ param(
[string] $Target = 'x64',
[ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')]
[string] $Configuration = 'RelWithDebInfo',
[ValidateSet('cpu', 'cuda', 'hipblas')]
[string] $acceleration = 'cpu',
[ValidateSet('generic', 'nvidia', 'amd')]
[string] $acceleration = 'generic',
[switch] $BuildInstaller,
[switch] $SkipDeps
)
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/utils.zsh/check_macos
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ local macos_version=$(sw_vers -productVersion)

log_group 'Install macOS build requirements'
log_info 'Checking macOS version...'
if ! is-at-least 11.0 ${macos_version}; then
log_error "Minimum required macOS version is 11.0, but running on macOS ${macos_version}"
if ! is-at-least 12.0 ${macos_version}; then
log_error "Minimum required macOS version is 12.0, but running on macOS ${macos_version}"
return 2
else
log_status "macOS ${macos_version} is recent"
Expand Down
1 change: 0 additions & 1 deletion .github/scripts/utils.zsh/setup_ccache
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ if (( ${+commands[ccache]} )) {

typeset -gx CCACHE_CONFIGPATH="${project_root}/.ccache.conf"

ccache --set-config=run_second_cpp=true
ccache --set-config=direct_mode=true
ccache --set-config=inode_cache=true
ccache --set-config=compiler_check=content
Expand Down
19 changes: 5 additions & 14 deletions .github/scripts/utils.zsh/setup_linux
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,11 @@ if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) {

local -a _qt_packages=()

if (( QT_VERSION == 5 )) {
_qt_packages+=(
qtbase5-dev${suffix}
libqt5svg5-dev${suffix}
qtbase5-private-dev${suffix}
libqt5x11extras5-dev${suffix}
)
} else {
_qt_packages+=(
qt6-base-dev${suffix}
libqt6svg6-dev${suffix}
qt6-base-private-dev${suffix}
)
}
_qt_packages+=(
qt6-base-dev${suffix}
libqt6svg6-dev${suffix}
qt6-base-private-dev${suffix}
)

sudo apt-get install ${apt_args} ${_qt_packages}
log_group
Expand Down
74 changes: 66 additions & 8 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

macos-build:
name: Build for macOS 🍏
runs-on: macos-13
runs-on: macos-14
needs: check-event
strategy:
matrix:
Expand Down Expand Up @@ -92,13 +92,18 @@ jobs:
print "pluginName=${product_name}" >> $GITHUB_OUTPUT
print "pluginVersion=${product_version}" >> $GITHUB_OUTPUT

- uses: maxim-lobanov/setup-xcode@v1.6.0
id: set-xcode-version
with:
xcode-version: 16.2

- uses: actions/cache@v4
id: ccache-cache
with:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-ccache-${{ needs.check-event.outputs.config }}
key: ${{ runner.os }}-ccache-${{ needs.check-event.outputs.config }}-${{ matrix.architecture }}
restore-keys: |
${{ runner.os }}-ccache-
${{ runner.os }}-ccache-${{ matrix.architecture }}-

- name: Set Up Codesigning 🔑
uses: ./.github/actions/setup-macos-codesigning
Expand Down Expand Up @@ -157,10 +162,30 @@ jobs:
name: Build for Ubuntu 🐧
runs-on: ubuntu-22.04
needs: check-event
strategy:
matrix:
acceleration: [generic, nvidia, amd]
defaults:
run:
shell: bash
steps:
- name: Free Disk Space (Ubuntu)
if: ${{ matrix.acceleration == 'amd' || matrix.acceleration == 'nvidia' }}
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# Needs to be false to prevent running out of memory
swap-storage: false
# large-packages takes a long time so don't remove them unless we need to
large-packages: false

android: true
dotnet: true
haskell: true
docker-images: true

- uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -178,6 +203,36 @@ jobs:
echo "pluginName=${product_name}" >> $GITHUB_OUTPUT
echo "pluginVersion=${product_version}" >> $GITHUB_OUTPUT

- name: "Install Vulkan SDK"
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt update
sudo apt -y install vulkan-sdk

# CUDA toolkit needed for linking against so it can be found when looking up package dependencies
- name: "Install CUDA toolkit 12.8"
if: ${{ matrix.acceleration == 'nvidia' }}
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt -y install cuda-12-8
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

# hip SDK needed for linking against so it can be found when looking up package dependencies
- name: "Install AMD hip SDK v6.4.2"
if: ${{ matrix.acceleration == 'amd' }}
run: |
wget https://repo.radeon.com/amdgpu-install/6.4.2/ubuntu/jammy/amdgpu-install_6.4.60402-1_all.deb
sudo apt install ./amdgpu-install_6.4.60402-1_all.deb
sudo apt update
sudo apt install python3-setuptools python3-wheel
sudo usermod -a -G render,video $LOGNAME # Add the current user to the render and video groups
sudo apt install rocm
sudo apt update && sudo apt install hipblas

- uses: actions/cache@v4
id: ccache-cache
with:
Expand All @@ -194,40 +249,43 @@ jobs:
with:
target: x86_64
config: ${{ needs.check-event.outputs.config }}
acceleration: ${{ matrix.acceleration }}

- name: Package Plugin 📀
uses: ./.github/actions/package-plugin
with:
package: ${{ fromJSON(needs.check-event.outputs.package) }}
target: x86_64
config: ${{ needs.check-event.outputs.config }}
acceleration: ${{ matrix.acceleration }}

- name: Upload Source Tarball 🗜️
uses: actions/upload-artifact@v4
if: ${{ matrix.acceleration == 'generic' }}
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-sources-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-source.*

- name: Upload Artifacts 📡
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*.*
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ matrix.acceleration }}-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64-linux-gnu-${{ matrix.acceleration }}*.*

- name: Upload debug symbol artifacts 🪲
uses: actions/upload-artifact@v4
if: ${{ fromJSON(needs.check-event.outputs.package) }}
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*-dbgsym.ddeb
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ matrix.acceleration }}-${{ needs.check-event.outputs.commitHash }}-dbgsym
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64-linux-gnu--${{ matrix.acceleration }}*-dbgsym.ddeb

windows-build:
name: Build for Windows 🪟
runs-on: windows-2022
needs: check-event
strategy:
matrix:
acceleration: [cpu, hipblas, cuda]
acceleration: [generic, nvidia, amd]
defaults:
run:
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_call:
jobs:
clang-format:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ jobs:
commit_hash="${GITHUB_SHA:0:9}"

variants=(
'windows-x64-cpu;zip|exe'
'windows-x64-cuda;zip|exe'
'windows-x64-hipblas;zip|exe'
'windows-x64-generic;zip|exe'
'windows-x64-nvidia;zip|exe'
'windows-x64-amd;zip|exe'
'macos-arm64;tar.xz|pkg'
'macos-x86_64;tar.xz|pkg'
'ubuntu-22.04-x86_64;tar.xz|deb|ddeb'
'ubuntu-22.04-x86_64-generic;tar.xz|deb|ddeb'
'ubuntu-22.04-x86_64-nvidia;tar.xz|deb|ddeb'
'ubuntu-22.04-x86_64-amd;tar.xz|deb|ddeb'
'sources;tar.xz'
)

Expand Down
39 changes: 22 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16...3.26)
cmake_minimum_required(VERSION 3.28...4.12)

include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake" NO_POLICY_SCOPE)

Expand All @@ -7,6 +7,11 @@ project(${_name} VERSION ${_version})
option(ENABLE_FRONTEND_API "Use obs-frontend-api for UI functionality" ON)
option(ENABLE_QT "Use Qt functionality" ON)

if(CMAKE_MAJOR_VERSION EQUAL 4)
message(STATUS "CMake 4 detected")
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
endif()

include(compilerconfig)
include(defaults)
include(helpers)
Expand All @@ -22,8 +27,8 @@ if(ENABLE_FRONTEND_API)
endif()

if(ENABLE_QT)
find_qt(COMPONENTS Widgets Core)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt::Core Qt::Widgets)
find_package(Qt6 COMPONENTS Widgets Core)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets)
target_compile_options(
${CMAKE_PROJECT_NAME} PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header
-Wno-comma>)
Expand All @@ -34,8 +39,10 @@ if(ENABLE_QT)
AUTORCC ON)
endif()

include(cmake/FindLibAv.cmake)
find_libav()
if(APPLE OR WIN32)
include(cmake/FindLibAv.cmake)
find_libav()
endif()

set(USE_SYSTEM_CURL
OFF
Expand All @@ -50,19 +57,17 @@ else()
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE libcurl)
endif()

if(WIN32)
if(DEFINED ENV{ACCELERATION})
set(ACCELERATION
$ENV{ACCELERATION}
CACHE STRING "Acceleration to use" FORCE)
endif()
if(NOT DEFINED ACCELERATION)
set(ACCELERATION
"cpu"
CACHE STRING "Acceleration to use")
endif()
set_property(CACHE ACCELERATION PROPERTY STRINGS "cpu" "hipblas" "cuda")
if(DEFINED ENV{ACCELERATION})
set(ACCELERATION
$ENV{ACCELERATION}
CACHE STRING "Acceleration to use" FORCE)
endif()
if(NOT DEFINED ACCELERATION)
set(ACCELERATION
"generic"
CACHE STRING "Acceleration to use")
endif()
set_property(CACHE ACCELERATION PROPERTY STRINGS "generic" "nvidia" "amd")

include(cmake/BuildWhispercpp.cmake)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Whispercpp)
Expand Down
Loading
Loading