Skip to content

Commit

Permalink
sci-libs/torchaudio: Fix CUDA 12.5 build
Browse files Browse the repository at this point in the history
See pytorch/audio#3811

Signed-off-by: wangjiezhe <wangjiezhe@gmail.com>
  • Loading branch information
wangjiezhe committed Jan 5, 2025
1 parent 9d0a0a6 commit 498f67b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 7797f83e1d66ff78872763e1da3a5fb2f0534c40 Mon Sep 17 00:00:00 2001
From: Markus Hennerbichler <markushennerbichler@gmail.com>
Date: Mon, 15 Jul 2024 14:07:13 +0100
Subject: [PATCH] Fix CUDA 12.5 build

CUDA 12.5 removed the FLT_MAX symbol.
This was previously used without being explicitly imported.
FLT_MAX is defined in <float.h>, including this header fixes the issue
---
src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.cu | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.cu b/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.cu
index 4ca8f1bf24..e6192155a2 100644
--- a/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.cu
+++ b/src/libtorchaudio/cuctc/src/ctc_prefix_decoder_kernel_v2.cu
@@ -24,6 +24,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <algorithm>
+#include <float.h>
#include "ctc_fast_divmod.cuh"
#include "cub/cub.cuh"
#include "device_data_wrap.h"
6 changes: 5 additions & 1 deletion sci-libs/torchaudio/torchaudio-2.5.0.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023-2024 Gentoo Authors
# Copyright 2023-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
Expand Down Expand Up @@ -29,6 +29,10 @@ RDEPEND="
"
DEPEND="${RDEPEND}"

PATCHES=(
"${FILESDIR}"/${P}-Fix-CUDA-12.5-build.patch
)

src_prepare() {
export USE_FFMPEG=$(usex ffmpeg)
export FFMPEG_ROOT="/usr"
Expand Down

0 comments on commit 498f67b

Please sign in to comment.