Skip to content

Commit eec4c11

Browse files
authored
Merge branch 'develop' into exception
2 parents f872278 + e1b030a commit eec4c11

File tree

9 files changed

+105
-28
lines changed

9 files changed

+105
-28
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
# Skip jobs when only documentation files are changed
9+
paths-ignore:
10+
- '**.md'
11+
- '**.rst'
12+
- 'docs/**'
13+
pull_request:
14+
paths-ignore:
15+
- '**.md'
16+
- '**.rst'
17+
- 'docs/**'
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
container: ["alicevision/popsift-deps:cuda10.2-ubuntu18.04", "alicevision/popsift-deps:cuda11.8.0-ubuntu20.04", "alicevision/popsift-deps:cuda12.1.0-ubuntu22.04"]
25+
build_tpe: ["Release", "Debug"]
26+
exclude:
27+
# excludes debug on this one as it has a segmentation fault during the compilation (!)
28+
- container: "alicevision/popsift-deps:cuda12.1.0-ubuntu22.04"
29+
build_tpe: "Debug"
30+
31+
container:
32+
image: ${{ matrix.container }}
33+
34+
env:
35+
DEPS_INSTALL_DIR: /opt/
36+
BUILD_TYPE: ${{ matrix.build_tpe }}
37+
CTEST_OUTPUT_ON_FAILURE: 1
38+
steps:
39+
- uses: actions/checkout@v2
40+
41+
- name: Prepare File Tree
42+
run: |
43+
mkdir ./build
44+
mkdir ./build_as_3rdparty
45+
mkdir ../popsift_install
46+
47+
- name: Configure CMake
48+
working-directory: ./build
49+
run: |
50+
cmake .. \
51+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
52+
-DBUILD_SHARED_LIBS:BOOL=ON \
53+
-DCMAKE_PREFIX_PATH="${DEPS_INSTALL_DIR}" \
54+
-DPopSift_BUILD_DOCS:BOOL=OFF \
55+
-DCMAKE_INSTALL_PREFIX:PATH=$PWD/../../popsift_install
56+
57+
- name: Build
58+
working-directory: ./build
59+
run: |
60+
make -j$(nproc) install
61+
62+
- name: Build As Third Party
63+
working-directory: ./build_as_3rdparty
64+
run: |
65+
cmake ../src/application \
66+
-DBUILD_SHARED_LIBS:BOOL=ON \
67+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
68+
-DCMAKE_PREFIX_PATH:PATH="$PWD/../../popsift_install;${DEPS_INSTALL_DIR}"
69+
make -j$(nproc)

Dockerfile_deps

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL maintainer="AliceVision Team [email protected]"
77
# see https://hub.docker.com/r/nvidia/cuda/
88
#
99
# For example, to create a ubuntu 16.04 with cuda 8.0 for development, use
10-
# docker build --build-arg CUDA_TAG=8.0 --tag alicevision/popsift-deps:cuda${CUDA_TAG}-ubuntu${OS_TAG} .
10+
# docker build --build-arg CUDA_TAG=8.0 --tag alicevision/popsift-deps:cuda${CUDA_TAG}-ubuntu${OS_TAG} -f Dockerfile_deps .
1111
#
1212
# then execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0))
1313
# docker run -it --runtime=nvidia popsift_deps
@@ -32,12 +32,12 @@ RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommend
3232
libboost-thread-dev \
3333
&& rm -rf /var/lib/apt/lists/*
3434

35-
# Manually install cmake
35+
# Manually install cmake
3636
WORKDIR /tmp/cmake
37-
ENV CMAKE_VERSION=3.17
37+
ENV CMAKE_VERSION=3.24
3838
ENV CMAKE_VERSION_FULL=${CMAKE_VERSION}.2
39-
RUN wget https://cmake.org/files/v3.17/cmake-${CMAKE_VERSION_FULL}.tar.gz && \
40-
tar zxvf cmake-${CMAKE_VERSION_FULL}.tar.gz && \
39+
RUN wget https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION_FULL}.tar.gz && \
40+
tar zxf cmake-${CMAKE_VERSION_FULL}.tar.gz && \
4141
cd cmake-${CMAKE_VERSION_FULL} && \
4242
./bootstrap --prefix=/usr/local -- -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_USE_OPENSSL:BOOL=ON && \
4343
make -j$(nproc) install && \

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
# PopSift
33

4-
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3728/badge)](https://bestpractices.coreinfrastructure.org/projects/3728) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8b0f7a68bc0d4df2ac89c6e732917caa)](https://app.codacy.com/manual/alicevision/popsift?utm_source=github.com&utm_medium=referral&utm_content=alicevision/popsift&utm_campaign=Badge_Grade_Settings)
4+
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3728/badge)](https://bestpractices.coreinfrastructure.org/projects/3728)
5+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/64f9192b53df46b483e7cf5be7e2dddd)](https://app.codacy.com/gh/alicevision/popsift/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
56

67
PopSift is an open-source implementation of the SIFT algorithm in CUDA.
78
PopSift tries to stick as closely as possible to David Lowe's famous paper [1], while extracting features from an image in real-time at least on an NVidia GTX 980 Ti GPU.
@@ -100,10 +101,12 @@ In particular, users can choose to generate results very similar to VLFeat or re
100101
We acknowledge that there is at least one SIFT implementation that is vastly faster, but it makes considerable sacrifices in terms of accuracy and compatibility.
101102

102103
## Continuous integration:
103-
- [![Build Status](https://travis-ci.org/alicevision/popsift.svg?branch=master)](https://travis-ci.org/alicevision/popsift) master branch.
104-
- [![Build Status](https://travis-ci.org/alicevision/popsift.svg?branch=develop)](https://travis-ci.org/alicevision/popsift) develop branch.
105-
- [![Build status](https://ci.appveyor.com/api/projects/status/rsm5269hs288c2ji/branch/develop?svg=true)](https://ci.appveyor.com/project/AliceVision/popsift/branch/develop)
106-
develop branch.
104+
105+
* ![Continuous Integration](https://github.com/alicevision/popsift/workflows/Continuous%20Integration/badge.svg?branch=master) master branch on Linux.
106+
107+
* ![Continuous Integration](https://github.com/alicevision/popsift/workflows/Continuous%20Integration/badge.svg?branch=develop) develop branch on Linux.
108+
109+
* [![Build status](https://ci.appveyor.com/api/projects/status/rsm5269hs288c2ji/branch/develop?svg=true)](https://ci.appveyor.com/project/AliceVision/popsift/branch/develop) develop branch on Windows.
107110

108111
## License
109112

cmake/ChooseCudaCC.cmake

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function(chooseCudaCC SUPPORTED_CC SUPPORTED_GENCODE_FLAGS)
6565

6666
set(CC_LIST_BY_SYSTEM_PROCESSOR "")
6767
if(CMAKE_SYSTEM_PROCESSOR IN_LIST OTHER_SUPPORTED_PROCESSORS)
68-
list(APPEND CC_LIST_BY_SYSTEM_PROCESSOR "20;21;30;35;50;52;60;61;70;75;80;86")
68+
list(APPEND CC_LIST_BY_SYSTEM_PROCESSOR "20;21;30;35;50;52;60;61;70;75;80;86;89;90")
6969
endif()
7070
if(CMAKE_SYSTEM_PROCESSOR IN_LIST TEGRA_SUPPORTED_PROCESSORS)
7171
list(APPEND CC_LIST_BY_SYSTEM_PROCESSOR "32;53;62;72")
@@ -78,10 +78,17 @@ function(chooseCudaCC SUPPORTED_CC SUPPORTED_GENCODE_FLAGS)
7878
# Default setting of the CUDA CC versions to compile.
7979
# Shortening the lists saves a lot of compile time.
8080
#
81-
set(CUDA_MIN_CC 20)
82-
set(CUDA_MAX_CC 86)
83-
if(CUDA_VERSION VERSION_GREATER_EQUAL 11.1)
81+
82+
# The current version last time this list was updated was CUDA 12.1.
83+
if(CUDA_VERSION VERSION_GREATER_EQUAL 12)
84+
set(CUDA_MIN_CC 50)
85+
set(CUDA_MAX_CC 90)
86+
elseif(CUDA_VERSION VERSION_GREATER_EQUAL 11.8)
87+
set(CUDA_MIN_CC 35)
88+
set(CUDA_MAX_CC 90)
89+
elseif(CUDA_VERSION VERSION_GREATER_EQUAL 11.1)
8490
set(CUDA_MIN_CC 35)
91+
set(CUDA_MAX_CC 86)
8592
elseif(CUDA_VERSION_MAJOR GREATER_EQUAL 11)
8693
set(CUDA_MIN_CC 35)
8794
set(CUDA_MAX_CC 80)
@@ -92,8 +99,10 @@ function(chooseCudaCC SUPPORTED_CC SUPPORTED_GENCODE_FLAGS)
9299
set(CUDA_MIN_CC 30)
93100
set(CUDA_MAX_CC 72)
94101
elseif(CUDA_VERSION_MAJOR GREATER_EQUAL 8)
102+
set(CUDA_MIN_CC 20)
95103
set(CUDA_MAX_CC 62)
96104
elseif(CUDA_VERSION_MAJOR GREATER_EQUAL 7)
105+
set(CUDA_MIN_CC 20)
97106
set(CUDA_MAX_CC 53)
98107
else()
99108
message(FATAL_ERROR "We do not support a CUDA SDK below version 7.0")

src/popsift/common/device_prop.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ bool device_prop_t::checkLimit_2DsurfLayered( int& width, int& height, int& laye
274274
std::cerr << __FILE__ << ":" << __LINE__
275275
<< ": CUDA device " << currentDevice << std::endl
276276
<< " does not support layered 2D surfaces " << width
277-
<< " bytes wide." << endl;
277+
<< " pixels wide." << endl;
278278
}
279279
width = ptr->maxSurface2DLayered[0];
280280
returnSuccess = false;

src/popsift/common/device_prop.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ class device_prop_t
9191
/**
9292
* @brief Check if a request exceeds the current CUDA device's limit in
9393
* surface2DLayered dimensions. surface2DLayered is the writable equivalent
94-
* to texture2DLayered, but the width must be given in bytes, not elements.
95-
* Since we use float, images cannot be as wide as expected.
94+
* to texture2DLayered.
9695
* @param[in,out] width Desired width of the texture.
9796
* @param[in,out] height Desired height of the texture.
9897
* @param[in,out] layers Desired depth of the texture.

src/popsift/common/plane_2d.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ template <typename T> struct PitchPlane2D : public PlaneT<T>
170170
PlaneBase::freeHost2D( this->data, mode );
171171
}
172172
__host__ __device__
173-
inline short getPitchInBytes( ) const { return _pitchInBytes; }
173+
inline size_t getPitchInBytes( ) const { return _pitchInBytes; }
174174

175175
protected:
176-
int _pitchInBytes; // pitch width in bytes
176+
size_t _pitchInBytes; // pitch width in bytes
177177
};
178178

179179
/*************************************************************
@@ -340,7 +340,7 @@ template <typename T> class Plane2D : public PitchPlane2D<T>
340340
__host__ __device__
341341
inline short getHeight( ) const { return _rows; }
342342
__host__ __device__
343-
inline short getByteSize( ) const { return this->_pitchInBytes*_rows; }
343+
inline size_t getByteSize( ) const { return this->_pitchInBytes * _rows; }
344344

345345
__host__ inline void allocDev( int w, int h ) {
346346
_cols = w;

src/popsift/popsift.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,7 @@ PopSift::AllocTest PopSift::testTextureFit( int width, int height )
187187
*/
188188
int depth = _config.levels + 3;
189189

190-
/* Surfaces have a limited width in bytes, not in elements.
191-
* Our DOG pyramid stores 4/byte floats, so me must check for
192-
* that width.
193-
*/
194-
int byteWidth = width * sizeof(float);
195-
retval = _device_properties.checkLimit_2DsurfLayered( byteWidth,
190+
retval = _device_properties.checkLimit_2DsurfLayered( width,
196191
height,
197192
depth,
198193
warn );
@@ -219,13 +214,13 @@ std::string PopSift::testTextureFitErrorString( AllocTest err, int width, int he
219214
{
220215
const float upscaleFactor = _config.getUpscaleFactor();
221216
const float scaleFactor = 1.0f / powf( 2.0f, -upscaleFactor );
222-
int w = ceilf( width * scaleFactor ) * sizeof(float);
217+
int w = ceilf( width * scaleFactor );
223218
int h = ceilf( height * scaleFactor );
224219
int d = _config.levels + 3;
225220

226221
_device_properties.checkLimit_2DsurfLayered( w, h, d, false );
227222

228-
w = w / scaleFactor / sizeof(float);
223+
w = w / scaleFactor;
229224
h = h / scaleFactor;
230225
ostr << "E Cannot use"
231226
<< (upscaleFactor==1 ? " default " : " ")

src/popsift/s_filtergrid.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
#if ! POPSIFT_IS_DEFINED(POPSIFT_DISABLE_GRID_FILTER)
2020

2121
#include <thrust/copy.h>
22+
#include <thrust/count.h>
2223
#include <thrust/device_vector.h>
2324
#include <thrust/execution_policy.h>
2425
#include <thrust/host_vector.h>
26+
#include <thrust/iterator/constant_iterator.h>
2527
#include <thrust/iterator/discard_iterator.h>
2628
#include <thrust/sequence.h>
2729
#include <thrust/sort.h>

0 commit comments

Comments
 (0)