From fe73195d950e87f0bb6bc91da8e9d52f16d5abac Mon Sep 17 00:00:00 2001 From: Simone Gasparini Date: Thu, 30 Oct 2025 22:02:32 +0100 Subject: [PATCH] [popsift] update to v0.10.0 (#48001) --- ports/popsift/144.patch | 25 -- ports/popsift/cuda_12_1.patch | 49 --- .../popsift/fix_missing_thrust_include.patch | 21 -- ports/popsift/portfile.cmake | 19 +- ports/popsift/remove-nvtx-macros.diff | 340 ------------------ ports/popsift/vcpkg.json | 5 +- scripts/ci.baseline.txt | 4 - scripts/ci.feature.baseline.txt | 4 - versions/baseline.json | 4 +- versions/p-/popsift.json | 5 + 10 files changed, 21 insertions(+), 455 deletions(-) delete mode 100644 ports/popsift/144.patch delete mode 100644 ports/popsift/cuda_12_1.patch delete mode 100644 ports/popsift/fix_missing_thrust_include.patch delete mode 100644 ports/popsift/remove-nvtx-macros.diff diff --git a/ports/popsift/144.patch b/ports/popsift/144.patch deleted file mode 100644 index c2d10fdf66..0000000000 --- a/ports/popsift/144.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7b664e27ca2865f3e06101d50415f2943d2de58c Mon Sep 17 00:00:00 2001 -From: Azhng -Date: Tue, 21 Feb 2023 19:24:57 +0000 -Subject: [PATCH] add required thrust include for s_filtergrid.cu - ---- - src/popsift/s_filtergrid.cu | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/popsift/s_filtergrid.cu b/src/popsift/s_filtergrid.cu -index 301c6a96..a766c2de 100644 ---- a/src/popsift/s_filtergrid.cu -+++ b/src/popsift/s_filtergrid.cu -@@ -19,9 +19,11 @@ - #if ! POPSIFT_IS_DEFINED(POPSIFT_DISABLE_GRID_FILTER) - - #include -+#include - #include - #include - #include -+#include - #include - #include - #include diff --git a/ports/popsift/cuda_12_1.patch b/ports/popsift/cuda_12_1.patch deleted file mode 100644 index e8dbb8b787..0000000000 --- a/ports/popsift/cuda_12_1.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/cmake/ChooseCudaCC.cmake b/cmake/ChooseCudaCC.cmake -index d9bc6c2..0ac4fa9 100755 ---- a/cmake/ChooseCudaCC.cmake -+++ b/cmake/ChooseCudaCC.cmake -@@ -65,7 +65,8 @@ function(chooseCudaCC SUPPORTED_CC SUPPORTED_GENCODE_FLAGS) - - set(CC_LIST_BY_SYSTEM_PROCESSOR "") - if(CMAKE_SYSTEM_PROCESSOR IN_LIST OTHER_SUPPORTED_PROCESSORS) -- list(APPEND CC_LIST_BY_SYSTEM_PROCESSOR "20;21;30;35;50;52;60;61;70;75;80;86") -+ # 87 is intentionally omitted, see discussion in https://github.com/alicevision/popsift/pull/146 -+ list(APPEND CC_LIST_BY_SYSTEM_PROCESSOR "20;21;30;35;50;52;60;61;70;75;80;86;89;90") - endif() - if(CMAKE_SYSTEM_PROCESSOR IN_LIST TEGRA_SUPPORTED_PROCESSORS) - list(APPEND CC_LIST_BY_SYSTEM_PROCESSOR "32;53;62;72") -@@ -78,10 +79,20 @@ function(chooseCudaCC SUPPORTED_CC SUPPORTED_GENCODE_FLAGS) - # Default setting of the CUDA CC versions to compile. - # Shortening the lists saves a lot of compile time. - # -- set(CUDA_MIN_CC 20) -- set(CUDA_MAX_CC 86) -- if(CUDA_VERSION_MAJOR GREATER_EQUAL 11) -+ -+ # The current version last time this list was updated was CUDA 12.1. -+ if(CUDA_VERSION VERSION_GREATER_EQUAL 12) -+ set(CUDA_MIN_CC 50) -+ set(CUDA_MAX_CC 90) -+ elseif(CUDA_VERSION VERSION_GREATER_EQUAL 11.8) -+ set(CUDA_MIN_CC 35) -+ set(CUDA_MAX_CC 90) -+ elseif(CUDA_VERSION VERSION_GREATER_EQUAL 11.1) -+ set(CUDA_MIN_CC 35) -+ set(CUDA_MAX_CC 86) -+ elseif(CUDA_VERSION_MAJOR GREATER_EQUAL 11) - set(CUDA_MIN_CC 35) -+ set(CUDA_MAX_CC 80) - elseif(CUDA_VERSION_MAJOR GREATER_EQUAL 10) - set(CUDA_MIN_CC 30) - set(CUDA_MAX_CC 75) -@@ -89,8 +100,10 @@ function(chooseCudaCC SUPPORTED_CC SUPPORTED_GENCODE_FLAGS) - set(CUDA_MIN_CC 30) - set(CUDA_MAX_CC 72) - elseif(CUDA_VERSION_MAJOR GREATER_EQUAL 8) -+ set(CUDA_MIN_CC 20) - set(CUDA_MAX_CC 62) - elseif(CUDA_VERSION_MAJOR GREATER_EQUAL 7) -+ set(CUDA_MIN_CC 20) - set(CUDA_MAX_CC 53) - else() - message(FATAL_ERROR "We do not support a CUDA SDK below version 7.0") diff --git a/ports/popsift/fix_missing_thrust_include.patch b/ports/popsift/fix_missing_thrust_include.patch deleted file mode 100644 index 69138afb56..0000000000 --- a/ports/popsift/fix_missing_thrust_include.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 273adb1c375b12f285694488280e04efd251a76a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Thomas=20Sch=C3=B6ps?= -Date: Sat, 28 Aug 2021 16:52:25 +0200 -Subject: [PATCH] Add missing thrust include - ---- - src/popsift/s_filtergrid.cu | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/popsift/s_filtergrid.cu b/src/popsift/s_filtergrid.cu -index 078eb114..301c6a96 100644 ---- a/src/popsift/s_filtergrid.cu -+++ b/src/popsift/s_filtergrid.cu -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include - #include - #include diff --git a/ports/popsift/portfile.cmake b/ports/popsift/portfile.cmake index c87c29bb63..5cd577b4e2 100644 --- a/ports/popsift/portfile.cmake +++ b/ports/popsift/portfile.cmake @@ -1,18 +1,21 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO alicevision/popsift - REF v0.9 - SHA512 56789520872203eea86e07e8210e00c0b67d85486af16df9d620b1aff10f8d9ef5d910cf1dda6c68af7ca2ed11658ab5414ac79117b543f91a7d8d6a96a17ce0 + REF v${VERSION} + SHA512 374a00542ff46ac8a8cf31b7a62c834e4e148c5f9ddd5f6a128e4284e637242c0ce55bf3ee6524e6555c8402332ec8863ca921cef36c0bacd9a1ada6c8e09b55 HEAD_REF develop - PATCHES - fix_missing_thrust_include.patch - 144.patch - cuda_12_1.patch - remove-nvtx-macros.diff ) vcpkg_find_cuda(OUT_CUDA_TOOLKIT_ROOT CUDA_TOOLKIT_ROOT) +# This is necessary as popsift uses cuda as first class language in CMake and +# depending on the version of CMake it might fail to find nvcc compiler. +if(CMAKE_HOST_WIN32) + set(NVCC_PATH ${CUDA_TOOLKIT_ROOT}/bin/nvcc.exe) +else() + set(NVCC_PATH ${CUDA_TOOLKIT_ROOT}/bin/nvcc) +endif() + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES apps PopSift_BUILD_EXAMPLES @@ -21,7 +24,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} - "-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT}" + "-DCMAKE_CUDA_COMPILER=${NVCC_PATH}" ) vcpkg_cmake_install() diff --git a/ports/popsift/remove-nvtx-macros.diff b/ports/popsift/remove-nvtx-macros.diff deleted file mode 100644 index fc1d4021b1..0000000000 --- a/ports/popsift/remove-nvtx-macros.diff +++ /dev/null @@ -1,340 +0,0 @@ -diff --git a/src/application/main.cpp b/src/application/main.cpp -index 0eec1c2..f30be1b 100755 ---- a/src/application/main.cpp -+++ b/src/application/main.cpp -@@ -32,9 +32,6 @@ - - #if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - #include --#else --#define nvtxRangePushA(a) --#define nvtxRangePop() - #endif - - using namespace std; -@@ -183,7 +180,9 @@ SiftJob* process_image( const string& inputFile, PopSift& PopSift ) - exit( -1 ); - } - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "load and convert image - devil" ); -+#endif - - ilImage img; - if( img.Load( inputFile.c_str() ) == false ) { -@@ -200,7 +199,9 @@ SiftJob* process_image( const string& inputFile, PopSift& PopSift ) - - image_data = img.GetData(); - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop( ); // "load and convert image - devil" -+#endif - - job = PopSift.enqueue( w, h, image_data ); - -@@ -209,7 +210,10 @@ SiftJob* process_image( const string& inputFile, PopSift& PopSift ) - else - #endif - { -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "load and convert image - pgmread" ); -+#endif -+ - int w{}; - int h{}; - image_data = readPGMfile( inputFile, w, h ); -@@ -217,7 +221,9 @@ SiftJob* process_image( const string& inputFile, PopSift& PopSift ) - exit( EXIT_FAILURE ); - } - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop( ); // "load and convert image - pgmread" -+#endif - - if( ! float_mode ) - { -@@ -251,16 +257,20 @@ void read_job( SiftJob* job, bool really_write ) - << endl; - - if( really_write ) { -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "Writing features to disk" ); -+#endif - - std::ofstream of( "output-features.txt" ); - feature_list->print( of, write_as_uchar ); - } - delete feature_list; - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - if( really_write ) { - nvtxRangePop( ); // Writing features to disk - } -+#endif - } - - int main(int argc, char **argv) -diff --git a/src/application/match.cpp b/src/application/match.cpp -index 852d9b6..7483dda 100755 ---- a/src/application/match.cpp -+++ b/src/application/match.cpp -@@ -32,9 +32,6 @@ - - #if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - #include --#else --#define nvtxRangePushA(a) --#define nvtxRangePop() - #endif - - using namespace std; -@@ -171,7 +168,9 @@ SiftJob* process_image( const string& inputFile, PopSift& PopSift ) - unsigned char* image_data; - SiftJob* job; - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "load and convert image" ); -+#endif - #ifdef USE_DEVIL - if( ! pgmread_loading ) - { -@@ -189,7 +188,9 @@ SiftJob* process_image( const string& inputFile, PopSift& PopSift ) - cout << "Loading " << w << " x " << h << " image " << inputFile << endl; - image_data = img.GetData(); - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop( ); -+#endif - - // PopSift.init( w, h ); - job = PopSift.enqueue( w, h, image_data ); -@@ -206,7 +207,9 @@ SiftJob* process_image( const string& inputFile, PopSift& PopSift ) - exit( EXIT_FAILURE ); - } - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop( ); -+#endif - - // PopSift.init( w, h ); - job = PopSift.enqueue( w, h, image_data ); -diff --git a/src/popsift/s_filtergrid.cu b/src/popsift/s_filtergrid.cu -index a766c2d..d8d3bb8 100644 ---- a/src/popsift/s_filtergrid.cu -+++ b/src/popsift/s_filtergrid.cu -@@ -11,9 +11,6 @@ - - #if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - #include --#else --#define nvtxRangePushA(a) --#define nvtxRangePop() - #endif - - #if ! POPSIFT_IS_DEFINED(POPSIFT_DISABLE_GRID_FILTER) -@@ -317,9 +314,13 @@ int Pyramid::extrema_filter_grid( const Config& conf, int ext_total ) - } - } - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "writing back count" ); -+#endif - writeDescCountersToDevice( ); -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop( ); -+#endif - - return ret_ext_total; - } -diff --git a/src/popsift/s_image.cu b/src/popsift/s_image.cu -index f26b8e3..92060d5 100755 ---- a/src/popsift/s_image.cu -+++ b/src/popsift/s_image.cu -@@ -17,9 +17,6 @@ - - #if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - #include --#else --#define nvtxRangePushA(a) --#define nvtxRangePop() - #endif - - using namespace std; -@@ -98,7 +95,9 @@ void Image::resetDimensions( int w, int h ) - destroyTexture( ); - createTexture( ); - } else { -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "reallocating host-side image memory" ); -+#endif - - _max_w = max( w, _max_w ); - _max_h = max( h, _max_h ); -@@ -112,20 +111,26 @@ void Image::resetDimensions( int w, int h ) - destroyTexture( ); - createTexture( ); - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop(); // "reallocating host-side image memory" -+#endif - } - } - - void Image::allocate( int w, int h ) - { -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "allocating host-side image memory" ); -+#endif - - _input_image_h.allocHost( w, h, popsift::CudaAllocated ); - _input_image_d.allocDev( w, h ); - - createTexture( ); - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop(); // "allocating host-side image memory" -+#endif - } - - void Image::destroyTexture( ) -@@ -222,7 +227,9 @@ void ImageFloat::resetDimensions( int w, int h ) - destroyTexture( ); - createTexture( ); - } else { -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "reallocating host-side image memory" ); -+#endif - - _max_w = max( w, _max_w ); - _max_h = max( h, _max_h ); -@@ -236,20 +243,26 @@ void ImageFloat::resetDimensions( int w, int h ) - destroyTexture( ); - createTexture( ); - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop(); // "reallocating host-side image memory" -+#endif - } - } - - void ImageFloat::allocate( int w, int h ) - { -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "allocating host-side image memory" ); -+#endif - - _input_image_h.allocHost( w, h, popsift::CudaAllocated ); - _input_image_d.allocDev( w, h ); - - createTexture( ); - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop(); // "allocating host-side image memory" -+#endif - } - - void ImageFloat::destroyTexture( ) -diff --git a/src/popsift/s_orientation.cu b/src/popsift/s_orientation.cu -index f6b36fc..f5e1011 100644 ---- a/src/popsift/s_orientation.cu -+++ b/src/popsift/s_orientation.cu -@@ -20,9 +20,6 @@ - - #if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - #include --#else --#define nvtxRangePushA(a) --#define nvtxRangePop() - #endif - - using namespace popsift; -diff --git a/src/popsift/sift_desc.cu b/src/popsift/sift_desc.cu -index b0eb0bd..5649edf 100644 ---- a/src/popsift/sift_desc.cu -+++ b/src/popsift/sift_desc.cu -@@ -23,9 +23,6 @@ - - #if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - #include --#else --#define nvtxRangePushA(a) --#define nvtxRangePop() - #endif - - using namespace popsift; -@@ -55,11 +52,15 @@ using namespace std; - __host__ - void Pyramid::descriptors( const Config& conf ) - { -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA("Reading orientation count"); -+#endif - - readDescCountersFromDevice( _octaves[0].getStream() ); - cudaStreamSynchronize( _octaves[0].getStream() ); -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop( ); -+#endif - - for( int octave=_num_octaves-1; octave>=0; octave-- ) - // for( int octave=0; octave<_num_octaves; octave++ ) -diff --git a/src/popsift/sift_pyramid.cu b/src/popsift/sift_pyramid.cu -index f5cb3e2..77332dc 100755 ---- a/src/popsift/sift_pyramid.cu -+++ b/src/popsift/sift_pyramid.cu -@@ -27,9 +27,6 @@ - - #if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - #include --#else --#define nvtxRangePushA(a) --#define nvtxRangePop() - #endif - - #define PYRAMID_PRINT_DEBUG 0 -@@ -287,12 +284,16 @@ FeaturesHost* Pyramid::get_descriptors( const Config& conf ) - - readDescCountersFromDevice(); - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "download descriptors" ); -+#endif - FeaturesHost* features = new FeaturesHost( hct.ext_total, hct.ori_total ); - - if( hct.ext_total == 0 || hct.ori_total == 0 ) - { -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop(); -+#endif - return features; - } - -@@ -300,9 +301,13 @@ FeaturesHost* Pyramid::get_descriptors( const Config& conf ) - prep_features<<>>( features->getDescriptors(), up_fac ); - POP_SYNC_CHK; - -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "register host memory" ); -+#endif - features->pin( ); -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop(); -+#endif - popcuda_memcpy_async( features->getFeatures(), - dobuf_shadow.features, - hct.ext_total * sizeof(Feature), -@@ -315,10 +320,14 @@ FeaturesHost* Pyramid::get_descriptors( const Config& conf ) - cudaMemcpyDeviceToHost, - _download_stream ); - cudaStreamSynchronize( _download_stream ); -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePushA( "unregister host memory" ); -+#endif - features->unpin( ); -+#if POPSIFT_IS_DEFINED(POPSIFT_USE_NVTX) - nvtxRangePop(); - nvtxRangePop(); -+#endif - - return features; - } diff --git a/ports/popsift/vcpkg.json b/ports/popsift/vcpkg.json index 8646c1204f..ff4af933e6 100644 --- a/ports/popsift/vcpkg.json +++ b/ports/popsift/vcpkg.json @@ -1,9 +1,10 @@ { "name": "popsift", - "version": "0.9", - "port-version": 6, + "version": "0.10.0", "description": "PopSift is an implementation of the SIFT algorithm in CUDA.", "homepage": "https://github.com/alicevision/popsift", + "documentation": "https://popsift.readthedocs.io/", + "license": "MPL-2.0", "supports": "!(uwp | arm | arm64 | android | x86)", "dependencies": [ "cuda", diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 2745fa1d27..fe6d194f80 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -653,10 +653,6 @@ plib:x64-android=fail pmdk:x64-android=fail pmdk:x64-osx=fail pmdk:x64-windows-static=fail -popsift:x64-windows-release=fail # popsift is broken with CUDA 12.6 and later, and we test with 12.8, see https://github.com/alicevision/popsift/issues/161 -popsift:x64-windows-static-md=fail -popsift:x64-windows-static=fail -popsift:x64-windows=fail python2:arm-neon-android=fail python2:arm64-android=fail python2:x64-android=fail diff --git a/scripts/ci.feature.baseline.txt b/scripts/ci.feature.baseline.txt index f3557116db..d859386188 100644 --- a/scripts/ci.feature.baseline.txt +++ b/scripts/ci.feature.baseline.txt @@ -225,10 +225,6 @@ pfring:x64-osx=fail platform-folders(uwp)=fail pmdk:x64-osx=fail pmdk:x64-windows-static=fail -popsift:x64-windows-release=fail -popsift:x64-windows-static-md=fail -popsift:x64-windows-static=fail -popsift:x64-windows=fail qbittorrent:x64-linux=fail # Not yet ready for these platforms. qbittorrent:x64-osx=fail # Not yet ready for these platforms. qt-advanced-docking-system(android)=fail diff --git a/versions/baseline.json b/versions/baseline.json index e913999828..1401d2ca16 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7633,8 +7633,8 @@ "port-version": 1 }, "popsift": { - "baseline": "0.9", - "port-version": 6 + "baseline": "0.10.0", + "port-version": 0 }, "portable-file-dialogs": { "baseline": "0.1.0", diff --git a/versions/p-/popsift.json b/versions/p-/popsift.json index 5735e0ab9d..bf8f92de9e 100644 --- a/versions/p-/popsift.json +++ b/versions/p-/popsift.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "ee43b750c42a10ab97cd677af23edd402867a13a", + "version": "0.10.0", + "port-version": 0 + }, { "git-tree": "3683687d6244a6c7f051930a912ad6ee13566d52", "version": "0.9",