@@ -330,6 +330,8 @@ ome_find_pkg(PKG_LIBAVUTIL libavutil OME_VER_LIBAVUTIL REINSTAL
330330
331331# NVIDIA CUDA/NVML
332332if (OME_HWACCEL_NVIDIA)
333+ ome_find_pkg (PKG_FFNVCODEC ffnvcodec OME_VER_NVCC_HDR REINSTALL_TARGET ffnvcodec )
334+
333335 set (_CUDA_ROOT "/usr/local/cuda" )
334336 find_library (_NV_CUDA_LIB cuda HINTS ${_CUDA_ROOT} /lib64 ${_CUDA_ROOT} /lib64/stubs /usr/lib/x86_64-linux-gnu )
335337 find_library (_NV_CUDART_LIB cudart HINTS ${_CUDA_ROOT} /lib64 /usr/lib/x86_64-linux-gnu )
@@ -392,6 +394,26 @@ if(OME_HWACCEL_NILOGAN)
392394 endif ()
393395endif ()
394396
397+ # Stubs
398+ # - Stubs lack pkg-config entries, so check for the stubs directory and install if missing.
399+ if (OME_HWACCEL_NVIDIA OR OME_HWACCEL_XMA OR OME_HWACCEL_NILOGAN)
400+ if (NOT IS_DIRECTORY "${OME_DEP_PREFIX} /lib/stubs" )
401+ message (STATUS "[OME] ${OME_DEP_PREFIX} /lib/stubs not found - installing stubs libraries ..." )
402+ execute_process (
403+ COMMAND ${CMAKE_COMMAND}
404+ -DOME_DEP_PREFIX=${OME_DEP_PREFIX}
405+ -DTARGET=stubs
406+ -P "${CMAKE_SOURCE_DIR} /cmake/InstallPrerequisites.cmake"
407+ RESULT_VARIABLE _stubs_ret
408+ )
409+ if (NOT _stubs_ret EQUAL 0)
410+ message (FATAL_ERROR "[OME] Failed to install stubs." )
411+ endif ()
412+ unset (_stubs_ret)
413+ endif ()
414+ endif ()
415+
416+
395417# jemalloc - required for Release builds, optional for Debug (can be forced with OME_ENABLE_JEMALLOC=ON)
396418# Note: when built with --enable-prof, jemalloc reports its pkg-config version as "<ver>_0"
397419# (e.g. "5.3.0_0"), so we use >= instead of = to avoid a false version mismatch.
@@ -440,24 +462,6 @@ else()
440462 message (STATUS "[OME] libx264: disabled by OME_ENABLE_X264=OFF" )
441463endif ()
442464
443- # ==============================================================================
444- # Stubs (GPU stub .so files) are installed unconditionally, regardless of hardware support.
445- # ==============================================================================
446- if (NOT IS_DIRECTORY "${OME_DEP_PREFIX} /lib/stubs" )
447- message (STATUS "[OME] ${OME_DEP_PREFIX} /lib/stubs not found - installing stubs libraries ..." )
448- execute_process (
449- COMMAND ${CMAKE_COMMAND}
450- -DOME_DEP_PREFIX=${OME_DEP_PREFIX}
451- -DTARGET=stubs
452- -P "${CMAKE_SOURCE_DIR} /cmake/InstallPrerequisites.cmake"
453- RESULT_VARIABLE _stubs_ret
454- )
455- if (NOT _stubs_ret EQUAL 0)
456- message (FATAL_ERROR "[OME] Failed to install stubs." )
457- endif ()
458- unset (_stubs_ret)
459- endif ()
460-
461465
462466# uuid (system library, not pkg-config)
463467find_library (UUID_LIB uuid REQUIRED )
0 commit comments