PR #25189 opened by Kilian (lusoris)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25189
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25189.patch

`bilateral_cuda`, `bwdif_cuda` and `chromakey_cuda` call 
`ff_cuda_load_module()` but do not link `cuda/load_helper.o`, so a build where 
one of them is the only CUDA filter fails to link. This adds the object to 
their `OBJS` lines, matching the other CUDA filters that load a module.

**How it was checked** (on master b60ab6c9a45)

- Configured each filter alone: `--disable-everything --enable-avfilter 
--enable-filter=<name> --enable-cuda-llvm --enable-ffnvcodec`.
- Before: `make ffmpeg_g` fails with `undefined reference to 
'ff_cuda_load_module'` for each of the three.
- After: all three link.
- Grepped every `libavfilter/*.c` that calls `ff_cuda_load_module`. With this 
change, each one has `cuda/load_helper.o` in its `OBJS` line.



>From ffb15c94c286c9d1af911991b3ad08724427372a Mon Sep 17 00:00:00 2001
From: lusoris <[email protected]>
Date: Sun, 18 Oct 2026 14:50:52 +0200
Subject: [PATCH] avfilter/Makefile: link cuda/load_helper.o into three CUDA
 filters

bilateral_cuda, bwdif_cuda and chromakey_cuda call ff_cuda_load_module(),
which lives in cuda/load_helper.c, but their OBJS lines do not pull that
object in; the other CUDA filters that load a module list it. A build
where one of these is the only CUDA filter fails to link, for example:

  vf_bwdif_cuda.c:312: undefined reference to `ff_cuda_load_module'

Reproduced for each filter with --disable-everything --enable-avfilter
--enable-filter=<name> --enable-cuda-llvm --enable-ffnvcodec; each links
after this change.

Signed-off-by: lusoris <[email protected]>
---
 libavfilter/Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 15d0b23af9..ef2542b98b 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -207,7 +207,8 @@ OBJS-$(CONFIG_BACKGROUNDKEY_FILTER)          += 
vf_backgroundkey.o
 OBJS-$(CONFIG_BBOX_FILTER)                   += bbox.o vf_bbox.o
 OBJS-$(CONFIG_BENCH_FILTER)                  += f_bench.o
 OBJS-$(CONFIG_BILATERAL_FILTER)              += vf_bilateral.o
-OBJS-$(CONFIG_BILATERAL_CUDA_FILTER)         += vf_bilateral_cuda.o 
vf_bilateral_cuda.ptx.o
+OBJS-$(CONFIG_BILATERAL_CUDA_FILTER)         += vf_bilateral_cuda.o 
vf_bilateral_cuda.ptx.o \
+                                                cuda/load_helper.o
 OBJS-$(CONFIG_BITPLANENOISE_FILTER)          += vf_bitplanenoise.o
 OBJS-$(CONFIG_BLACKDETECT_FILTER)            += vf_blackdetect.o
 OBJS-$(CONFIG_BLACKDETECT_VULKAN_FILTER)     += vf_blackdetect_vulkan.o
@@ -222,14 +223,15 @@ OBJS-$(CONFIG_BOXBLUR_OPENCL_FILTER)         += 
vf_avgblur_opencl.o opencl.o \
                                                 opencl/avgblur.o boxblur.o
 OBJS-$(CONFIG_BWDIF_FILTER)                  += vf_bwdif.o bwdifdsp.o 
yadif_common.o
 OBJS-$(CONFIG_BWDIF_CUDA_FILTER)             += vf_bwdif_cuda.o 
vf_bwdif_cuda.ptx.o \
-                                                yadif_common.o
+                                                yadif_common.o 
cuda/load_helper.o
 OBJS-$(CONFIG_BWDIF_VULKAN_FILTER)           += vf_bwdif_vulkan.o 
yadif_common.o vulkan.o vulkan_filter.o
 OBJS-$(CONFIG_CAS_FILTER)                    += vf_cas.o
 OBJS-$(CONFIG_CCREPACK_FILTER)               += vf_ccrepack.o
 OBJS-$(CONFIG_CHROMABER_VULKAN_FILTER)       += vf_chromaber_vulkan.o vulkan.o 
vulkan_filter.o
 OBJS-$(CONFIG_CHROMAHOLD_FILTER)             += vf_chromakey.o
 OBJS-$(CONFIG_CHROMAKEY_FILTER)              += vf_chromakey.o
-OBJS-$(CONFIG_CHROMAKEY_CUDA_FILTER)         += vf_chromakey_cuda.o 
vf_chromakey_cuda.ptx.o
+OBJS-$(CONFIG_CHROMAKEY_CUDA_FILTER)         += vf_chromakey_cuda.o 
vf_chromakey_cuda.ptx.o \
+                                                cuda/load_helper.o
 
 OBJS-$(CONFIG_CHROMANR_FILTER)               += vf_chromanr.o
 OBJS-$(CONFIG_CHROMASHIFT_FILTER)            += vf_chromashift.o
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to