You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a build script for Fedora that supports building with ROCm (AMD GPU), CUDA (NVIDIA GPU), or CPU-only acceleration. This might be helpful for other users who want to build the project on Fedora or use it as inspiration for other Linux distributions with ROCm or CUDA support.
I myself have only tested ROCm and it seems to work. CUDA would have to be tried by someone else and could give feedback here.
Usage
Save this script as build-fedora.sh in the project root
Make it executable: chmod +x build-fedora.sh
Run it: ./build-fedora.sh
#!/bin/bash# Exit on errorset -e
# Install required dependencies
sudo dnf install -y \
gcc \
gcc-c++ \
cmake \
ninja-build \
git \
openssl-devel \
qt6-qtbase-devel \
qt6-qtbase-private-devel \
qt6-qtsvg-devel \
qt6-qtwayland-devel \
qt6-qtshadertools-devel \
qt6-qtdeclarative-devel \
wayland-devel \
libX11-devel \
libXcomposite-devel \
libXinerama-devel \
libXrandr-devel \
libXfixes-devel \
libxcb-devel \
libcurl-devel \
ccache \
obs-studio-devel \
ffmpeg-devel \
x264-devel \
jansson-devel \
pulseaudio-libs-devel \
libv4l-devel \
freetype-devel \
fontconfig-devel \
mbedtls-devel \
swig \
luajit-devel \
python3-devel \
rocm-runtime \
rocm-hip-devel \
rocm-opencl-devel
# Create build directory
rm -rf build
mkdir -p build
# Set acceleration to hipblas (AMD ROCm)# Note: This seems to be needed only for the Windows builds, but I added it anyway as a precaution.# Possible values for ACCELERATION:# - "cpu" : CPU only, no hardware acceleration# - "cuda" : NVIDIA GPU acceleration using CUDA# - "hipblas" : AMD GPU acceleration using ROCm/HipBLASexport ACCELERATION="hipblas"# Configure with CMake# For different hardware acceleration support, use WHISPER_ADDITIONAL_CMAKE_ARGS:# CPU only:# -DWHISPER_ADDITIONAL_CMAKE_ARGS="-DWHISPER_BLAS=OFF -DWHISPER_CUBLAS=OFF -DWHISPER_OPENBLAS=OFF"# AMD GPU (ROCm/HipBLAS):# -DWHISPER_ADDITIONAL_CMAKE_ARGS="-DWHISPER_BLAS=ON -DWHISPER_HIPBLAS=ON -DWHISPER_OPENBLAS=OFF -DWHISPER_CUBLAS=OFF"# NVIDIA GPU (CUDA):# -DWHISPER_ADDITIONAL_CMAKE_ARGS="-DWHISPER_BLAS=ON -DWHISPER_HIPBLAS=OFF -DWHISPER_OPENBLAS=OFF -DWHISPER_CUBLAS=ON"
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DUSE_SYSTEM_CURL=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_PREFIX_PATH=/usr/lib64/cmake/Qt6 \
-DQT_VERSION=6 \
-DBUILD_SHARED_LIBS=ON \
-DWHISPER_ADDITIONAL_CMAKE_ARGS="-DWHISPER_BLAS=ON -DWHISPER_HIPBLAS=ON -DWHISPER_OPENBLAS=OFF -DWHISPER_CUBLAS=OFF"# Build using all available CPU cores (with retry logic)cd build
foriin {1..3};doif ninja -j$(nproc);thenbreakelseecho"Build attempt $i failed, retrying..."
sleep 5
fidone# Create plugin directories
mkdir -p ~/.config/obs-studio/plugins/obs-localvocal/bin/64bit
mkdir -p ~/.config/obs-studio/plugins/obs-localvocal/data
# Copy built files to OBS plugin directories (with backup)if [ -f"obs-localvocal.so" ];thenif [ -f~/.config/obs-studio/plugins/obs-localvocal/bin/64bit/obs-localvocal.so ];thenecho"Backing up existing plugin..."
cp -b ~/.config/obs-studio/plugins/obs-localvocal/bin/64bit/obs-localvocal.so \
~/.config/obs-studio/plugins/obs-localvocal/bin/64bit/obs-localvocal.so.bak
fi
cp obs-localvocal.so ~/.config/obs-studio/plugins/obs-localvocal/bin/64bit/
fi# Copy data files (with backup)if [ -d"../data" ];thenif [ -d~/.config/obs-studio/plugins/obs-localvocal/data ];thenecho"Backing up existing data..."
cp -r -b ~/.config/obs-studio/plugins/obs-localvocal/data \
~/.config/obs-studio/plugins/obs-localvocal/data.bak
fi
cp -R ../data/*~/.config/obs-studio/plugins/obs-localvocal/data/
fiecho"Build and installation completed!"
Notes
The script includes support for ROCm, CUDA, and CPU-only builds through CMake options
It automatically installs all required dependencies via dnf
Creates backups of existing installations before overwriting
Includes retry logic for build failures (specifically, the git checkouts often fail for me)
Comments explain how to configure for different acceleration methods
Disclaimer
This script was created with the help of an AI assistant. While it works for my setup, I don't have deep understanding of the entire codebase. I'm sharing it in hopes it might help other users or serve as a starting point for automated builds on other distributions.
Feel free to improve upon this or incorporate parts of it into the official build system!
I created a build script for Fedora that supports building with ROCm (AMD GPU), CUDA (NVIDIA GPU), or CPU-only acceleration. This might be helpful for other users who want to build the project on Fedora or use it as inspiration for other Linux distributions with ROCm or CUDA support.
Prerequisites
I myself have only tested ROCm and it seems to work. CUDA would have to be tried by someone else and could give feedback here.
Usage
build-fedora.sh
in the project rootchmod +x build-fedora.sh
./build-fedora.sh
Notes
Disclaimer
This script was created with the help of an AI assistant. While it works for my setup, I don't have deep understanding of the entire codebase. I'm sharing it in hopes it might help other users or serve as a starting point for automated builds on other distributions.
Feel free to improve upon this or incorporate parts of it into the official build system!
Related:
The text was updated successfully, but these errors were encountered: