Environment
- OS: Linux Mint 22.3 / Ubuntu 24.04 base
- Qt: 6.4.2 (system)
- video2x-qt6: master branch
Summary
Building video2x-qt6 from source on Ubuntu/Debian hits two issues that aren't obvious from the README:
Issue 1: ncnn is not available in Ubuntu/Debian apt repos
The ExternalProject_Add for Video2X in video2x-qt6/CMakeLists.txt does not forward a flag to disable the system ncnn lookup. When cmake configures the Video2X sub-project, it tries find_package(ncnn) and fails because ncnn has no Ubuntu/Debian package.
Suggested fix — add -DVIDEO2X_USE_EXTERNAL_NCNN=OFF to the CMAKE_ARGS block:
ExternalProject_Add(
Video2X
SOURCE_DIR ${CMAKE_SOURCE_DIR}/third_party/video2x
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/video2x-install
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF # force bundled ncnn
BUILD_ALWAYS ON
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE}
)
Issue 2: Runtime model files not found for ~/.local installs
libvideo2x's find_resource_file() in fsutils.cpp searches:
- The absolute path itself
/usr/share/video2x/
- Next to the executable (
get_executable_directory() / path)
If the binary is installed to ~/.local/bin/, models installed to the XDG standard location (~/.local/share/video2x/models/) are never found, causing silent task failure on start.
Suggested fix — add $XDG_DATA_HOME/video2x/ (falling back to ~/.local/share/video2x/) as a search path in find_resource_file().
Workarounds (for anyone hitting this now)
# 1. Add to ExternalProject CMAKE_ARGS in video2x-qt6/CMakeLists.txt:
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF
# 2. After build, make models findable next to binary
mkdir -p ~/.local/share/video2x/
cp -r build/video2x-install/share/video2x/models ~/.local/share/video2x/
ln -sf ~/.local/share/video2x/models ~/.local/bin/models
# 3. Fix rpath so .so files are found without LD_LIBRARY_PATH
patchelf --set-rpath ~/.local/lib ~/.local/lib/libvideo2x.so
patchelf --set-rpath ~/.local/lib ~/.local/bin/video2x-qt6
With these in place the GUI builds and runs correctly on Ubuntu 24.04. Great project overall!
Environment
Summary
Building video2x-qt6 from source on Ubuntu/Debian hits two issues that aren't obvious from the README:
Issue 1:
ncnnis not available in Ubuntu/Debian apt reposThe
ExternalProject_AddforVideo2Xinvideo2x-qt6/CMakeLists.txtdoes not forward a flag to disable the system ncnn lookup. When cmake configures the Video2X sub-project, it triesfind_package(ncnn)and fails because ncnn has no Ubuntu/Debian package.Suggested fix — add
-DVIDEO2X_USE_EXTERNAL_NCNN=OFFto theCMAKE_ARGSblock:Issue 2: Runtime model files not found for
~/.localinstallslibvideo2x'sfind_resource_file()infsutils.cppsearches:/usr/share/video2x/get_executable_directory() / path)If the binary is installed to
~/.local/bin/, models installed to the XDG standard location (~/.local/share/video2x/models/) are never found, causing silent task failure on start.Suggested fix — add
$XDG_DATA_HOME/video2x/(falling back to~/.local/share/video2x/) as a search path infind_resource_file().Workarounds (for anyone hitting this now)
With these in place the GUI builds and runs correctly on Ubuntu 24.04. Great project overall!