diff --git a/docs/getting_started.md b/docs/getting_started.md
index 554db9db..adc7a171 100644
--- a/docs/getting_started.md
+++ b/docs/getting_started.md
@@ -30,7 +30,9 @@ See [Docker](../DOCKER_README.md) for more information.
CUDA is used for NVFBC capture.
-@tip{See [CUDA GPUS](https://developer.nvidia.com/cuda-gpus) to cross-reference Compute Capability to your GPU.}
+@tip{See [CUDA GPUS](https://developer.nvidia.com/cuda-gpus) to cross-reference Compute Capability to your GPU.
+The table below applies to packages provided by LizardByte. If you use an official LizardByte package then you do not
+need to install CUDA.}
CUDA Compatibility
@@ -55,7 +57,7 @@ CUDA is used for NVFBC capture.
| 12.0.0 |
525.60.13 |
- 50;52;60;61;62;70;72;75;80;86;87;89;90 |
+ 50;52;60;61;62;70;72;75;80;86;87;89;90 |
sunshine-debian-bookworm-{arch}.deb |
@@ -68,7 +70,12 @@ CUDA is used for NVFBC capture.
| sunshine_{arch}.flatpak |
- | Sunshine (copr) |
+ Sunshine (copr - Fedora 40/41) |
+
+
+ | 12.8.1 |
+ 570.124.06 |
+ Sunshine (copr - Fedora 42) |
diff --git a/packaging/linux/fedora/Sunshine.spec b/packaging/linux/fedora/Sunshine.spec
index ca08f480..910c4fce 100644
--- a/packaging/linux/fedora/Sunshine.spec
+++ b/packaging/linux/fedora/Sunshine.spec
@@ -17,8 +17,6 @@ Source0: tarball.tar.gz
# BuildRequires: boost-devel >= 1.86.0
BuildRequires: cmake >= 3.25.0
-BuildRequires: gcc
-BuildRequires: gcc-c++
BuildRequires: libayatana-appindicator3-devel
BuildRequires: libcap-devel
BuildRequires: libcurl-devel
@@ -54,11 +52,22 @@ BuildRequires: which
BuildRequires: xorg-x11-server-Xvfb
# Conditional BuildRequires for cuda-gcc based on Fedora version
-%if 0%{?fedora} >= 40
-# this package conflicts with gcc on f39
-BuildRequires: cuda-gcc-c++
+%if 0%{?fedora} >= 40 && 0%{?fedora} <= 41
+BuildRequires: gcc13
+BuildRequires: gcc13-c++
+%global gcc_version 13
+%global cuda_version 12.6.3
+%global cuda_build 560.35.05
+%elif %{?fedora} >= 42
+BuildRequires: gcc14
+BuildRequires: gcc14-c++
+%global gcc_version 14
+%global cuda_version 12.8.1
+%global cuda_build 570.124.06
%endif
+%global cuda_dir %{_builddir}/cuda
+
Requires: libcap >= 2.22
Requires: libcurl >= 7.0
Requires: libdrm > 2.4.97
@@ -88,20 +97,14 @@ ls -a %{_builddir}/Sunshine
%autopatch -p1
%build
+# exit on error
+set -e
+
# Detect the architecture and Fedora version
architecture=$(uname -m)
-fedora_version=%{fedora}
cuda_supported_architectures=("x86_64" "aarch64")
-# set cuda_version based on Fedora version
-case "$fedora_version" in
- *)
- cuda_version="12.6.3"
- cuda_build="560.35.05"
- ;;
-esac
-
# prepare CMAKE args
cmake_args=(
"-B=%{_builddir}/Sunshine/build"
@@ -121,27 +124,23 @@ cmake_args=(
"-DSUNSHINE_PUBLISHER_ISSUE_URL=https://app.lizardbyte.dev/support"
)
+export CC=gcc-%{gcc_version}
+export CXX=g++-%{gcc_version}
+
function install_cuda() {
# check if we need to install cuda
- if [ -f "%{_builddir}/cuda/bin/nvcc" ]; then
+ if [ -f "%{cuda_dir}/bin/nvcc" ]; then
echo "cuda already installed"
return
fi
- if [ "$fedora_version" -ge 40 ]; then
- # update environment variables for CUDA, necessary when using cuda-gcc-c++
- export NVCC_PREPEND_FLAGS='-ccbin /usr/bin/g++-13'
- export PATH=/usr/bin/cuda:"%{_builddir}/cuda/bin:${PATH}"
- export LD_LIBRARY_PATH="%{_builddir}/cuda/lib64:${LD_LIBRARY_PATH}"
- fi
-
local cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
local cuda_suffix=""
if [ "$architecture" == "aarch64" ]; then
local cuda_suffix="_sbsa"
fi
- local url="${cuda_prefix}${cuda_version}/local_installers/cuda_${cuda_version}_${cuda_build}_linux${cuda_suffix}.run"
+ local url="${cuda_prefix}%{cuda_version}/local_installers/cuda_%{cuda_version}_%{cuda_build}_linux${cuda_suffix}.run"
echo "cuda url: ${url}"
wget \
"$url" \
@@ -157,23 +156,31 @@ function install_cuda() {
--override \
--silent \
--toolkit \
- --toolkitpath="%{_builddir}/cuda"
+ --toolkitpath="%{cuda_dir}"
rm "%{_builddir}/cuda.run"
+
+ # we need to patch math_functions.h on fedora 42
+ # see https://forums.developer.nvidia.com/t/error-exception-specification-is-incompatible-for-cospi-sinpi-cospif-sinpif-with-glibc-2-41/323591/3
+ if [ "%{?fedora}" -eq 42 ]; then
+ echo "Original math_functions.h:"
+ find "%{cuda_dir}" -name math_functions.h -exec cat {} \;
+
+ # Apply the patch
+ patch -p2 \
+ --backup \
+ --directory="%{cuda_dir}" \
+ --verbose \
+ < "%{_builddir}/Sunshine/packaging/linux/fedora/patches/f42/${architecture}/01-math_functions.patch"
+ fi
}
-# we need to clear these flags to avoid linkage errors with cuda-gcc-c++
-export CFLAGS=""
-export CXXFLAGS=""
-export FFLAGS=""
-export FCFLAGS=""
-export LDFLAGS=""
-export CC=gcc-13
-export CXX=g++-13
-
-if [ -n "$cuda_version" ] && [[ " ${cuda_supported_architectures[@]} " =~ " ${architecture} " ]]; then
+if [ -n "%{cuda_version}" ] && [[ " ${cuda_supported_architectures[@]} " =~ " ${architecture} " ]]; then
install_cuda
cmake_args+=("-DSUNSHINE_ENABLE_CUDA=ON")
- cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=%{_builddir}/cuda/bin/nvcc")
+ cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=%{cuda_dir}/bin/nvcc")
+ cmake_args+=("-DCMAKE_CUDA_HOST_COMPILER=gcc-%{gcc_version}")
+else
+ cmake_args+=("-DSUNSHINE_ENABLE_CUDA=OFF")
fi
# setup the version
diff --git a/packaging/linux/fedora/patches/f42/aarch64/01-math_functions.patch b/packaging/linux/fedora/patches/f42/aarch64/01-math_functions.patch
new file mode 100644
index 00000000..322fef1c
--- /dev/null
+++ b/packaging/linux/fedora/patches/f42/aarch64/01-math_functions.patch
@@ -0,0 +1,39 @@
+diff '--color=auto' -ur a/cuda/targets/sbsa-linux/include/crt/math_functions.h b/cuda/targets/sbsa-linux/include/crt/math_functions.h
+--- a/cuda/targets/sbsa-linux/include/crt/math_functions.h 2024-08-23 00:25:39.000000000 +0200
++++ b/cuda/targets/sbsa-linux/include/crt/math_functions.h 2025-02-17 01:19:44.270292640 +0100
+@@ -2553,7 +2553,7 @@
+ *
+ * \note_accuracy_double
+ */
+-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x);
++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x) noexcept (true);
+ /**
+ * \ingroup CUDA_MATH_SINGLE
+ * \brief Calculate the sine of the input argument
+@@ -2576,7 +2576,7 @@
+ *
+ * \note_accuracy_single
+ */
+-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x);
++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x) noexcept (true);
+ /**
+ * \ingroup CUDA_MATH_DOUBLE
+ * \brief Calculate the cosine of the input argument
+@@ -2598,7 +2598,7 @@
+ *
+ * \note_accuracy_double
+ */
+-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x);
++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x) noexcept (true);
+ /**
+ * \ingroup CUDA_MATH_SINGLE
+ * \brief Calculate the cosine of the input argument
+@@ -2620,7 +2620,7 @@
+ *
+ * \note_accuracy_single
+ */
+-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x);
++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x) noexcept (true);
+ /**
+ * \ingroup CUDA_MATH_DOUBLE
+ * \brief Calculate the sine and cosine of the first input argument
diff --git a/packaging/linux/fedora/patches/f42/x86_64/01-math_functions.patch b/packaging/linux/fedora/patches/f42/x86_64/01-math_functions.patch
new file mode 100644
index 00000000..5e522eb1
--- /dev/null
+++ b/packaging/linux/fedora/patches/f42/x86_64/01-math_functions.patch
@@ -0,0 +1,39 @@
+diff '--color=auto' -ur a/cuda/targets/x86_64-linux/include/crt/math_functions.h b/cuda/targets/x86_64-linux/include/crt/math_functions.h
+--- a/cuda/targets/x86_64-linux/include/crt/math_functions.h 2024-08-23 00:25:39.000000000 +0200
++++ b/cuda/targets/x86_64-linux/include/crt/math_functions.h 2025-02-17 01:19:44.270292640 +0100
+@@ -2553,7 +2553,7 @@
+ *
+ * \note_accuracy_double
+ */
+-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x);
++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x) noexcept (true);
+ /**
+ * \ingroup CUDA_MATH_SINGLE
+ * \brief Calculate the sine of the input argument
+@@ -2576,7 +2576,7 @@
+ *
+ * \note_accuracy_single
+ */
+-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x);
++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x) noexcept (true);
+ /**
+ * \ingroup CUDA_MATH_DOUBLE
+ * \brief Calculate the cosine of the input argument
+@@ -2598,7 +2598,7 @@
+ *
+ * \note_accuracy_double
+ */
+-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x);
++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x) noexcept (true);
+ /**
+ * \ingroup CUDA_MATH_SINGLE
+ * \brief Calculate the cosine of the input argument
+@@ -2620,7 +2620,7 @@
+ *
+ * \note_accuracy_single
+ */
+-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x);
++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x) noexcept (true);
+ /**
+ * \ingroup CUDA_MATH_DOUBLE
+ * \brief Calculate the sine and cosine of the first input argument