Skip to content

Commit 9e7388f

Browse files
committed
CHANGE: move cuda compute checks elsewhere
This was done to avoid superfluous checks for cuda compute capability, even though they are not needed
1 parent 6b35caa commit 9e7388f

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ ffmpeg-build-script v1.xx
340340
341341
Using 12 make jobs simultaneously.
342342
With GPL and non-free codecs
343-
CUDA env variable provided, building with compute capability 75
344343
cargo not installed. rav1e encoder will not be available.
345344
346345
building giflib - version 5.2.1

build-ffmpeg

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -278,18 +278,6 @@ if $NONFREE_AND_GPL; then
278278
echo "With GPL and non-free codecs"
279279
fi
280280

281-
# Check CUDA compute capability
282-
if [[ "$OSTYPE" == "linux-gnu" ]]; then
283-
if [ -n "$CUDA_COMPUTE_CAPABILITY" ]; then
284-
echo "CUDA env variable provided, building with compute capability $CUDA_COMPUTE_CAPABILITY"
285-
else
286-
# Set default value if no compute capability was found
287-
# Note that multi-architecture builds are not supported in ffmpeg
288-
# see https://patchwork.ffmpeg.org/comment/62905/
289-
export CUDA_COMPUTE_CAPABILITY=52
290-
echo "CUDA env variable not provided, using default compute capability $CUDA_COMPUTE_CAPABILITY"
291-
fi
292-
fi
293281

294282
if [ -n "$LDEXEFLAGS" ]; then
295283
echo "Start the build in full static mode."
@@ -929,6 +917,12 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
929917
if [ -z "$LDEXEFLAGS" ]; then
930918
CONFIGURE_OPTIONS+=("--enable-libnpp") # Only libnpp cannot be statically linked.
931919
fi
920+
if [ -z "$CUDA_COMPUTE_CAPABILITY" ]; then
921+
# Set default value if no compute capability was found
922+
# Note that multi-architecture builds are not supported in ffmpeg
923+
# see https://patchwork.ffmpeg.org/comment/62905/
924+
export CUDA_COMPUTE_CAPABILITY=52
925+
fi
932926
CONFIGURE_OPTIONS+=("--nvccflags=-gencode arch=compute_$CUDA_COMPUTE_CAPABILITY,code=sm_$CUDA_COMPUTE_CAPABILITY -O2")
933927
else
934928
CONFIGURE_OPTIONS+=("--disable-ffnvcodec")

0 commit comments

Comments
 (0)