Error running Optical Flow example

Hello! I was able to build the optical flow examples, but when I run the AppOFCuda example it throws an error.

What is interesting is that it seems to be the same error I had with 2.0 before I noticed today that the new 3.0 code is released. But I did delete the binary, then build and install from the 3.0 directory.

But here is the error I get:

taylor@twisted-desktop:~/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build$ /usr/local/bin/x64/AppOFCuda --input=/home/taylor/Pictures/photogrammetry/frames/PANA3638/PANA*.png --output=/home/taylor/Pictures/photogrammetry/frames/output
GPU in use: GeForce RTX 2080 Ti
DoInit : m_NvOFAPI->GetAPI()->nvOFInit(m_NvOFAPI->GetHandle(), &initParams)returned error 5 at /home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/NvOFBase/NvOFCuda.cpp;120

Or here is the full output, including the configure and build steps:

taylor@twisted-desktop:~/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build$ make clean
taylor@twisted-desktop:~/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build$ rm -rf *
taylor@twisted-desktop:~/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build$ cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- FreeImage include dir : /usr/include
-- FreeImage lib dir : /usr/lib/x86_64-linux-gnu/libfreeimage.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found version "11.3") 
cuda lib: /usr/lib/x86_64-linux-gnu/libcuda.so
cuda include: /usr/local/cuda/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/taylor/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build
taylor@twisted-desktop:~/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build$ make
[  6%] Building NVCC (Device) object AppOFCuda/CMakeFiles/AppOFCuda.dir/__/__/Common/Utils/AppOFCuda_generated_kernel.cu.o
Scanning dependencies of target AppOFCuda
[ 12%] Building CXX object AppOFCuda/CMakeFiles/AppOFCuda.dir/AppOFCuda.cpp.o
[ 18%] Building CXX object AppOFCuda/CMakeFiles/AppOFCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/NvOFBase/NvOF.cpp.o
[ 25%] Building CXX object AppOFCuda/CMakeFiles/AppOFCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/NvOFBase/NvOFCuda.cpp.o
[ 31%] Building CXX object AppOFCuda/CMakeFiles/AppOFCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/Utils/NvOFUtilsCuda.cpp.o
[ 37%] Building CXX object AppOFCuda/CMakeFiles/AppOFCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/Utils/NvOFUtils.cpp.o
[ 43%] Building CXX object AppOFCuda/CMakeFiles/AppOFCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/Utils/NvOFDataLoader.cpp.o
[ 50%] Linking CXX executable AppOFCuda
[ 50%] Built target AppOFCuda
[ 56%] Building NVCC (Device) object AppStereoDisparityCuda/CMakeFiles/AppStereoDisparityCuda.dir/__/__/Common/Utils/AppStereoDisparityCuda_generated_kernel.cu.o
Scanning dependencies of target AppStereoDisparityCuda
[ 62%] Building CXX object AppStereoDisparityCuda/CMakeFiles/AppStereoDisparityCuda.dir/AppStereoDisparityCuda.cpp.o
[ 68%] Building CXX object AppStereoDisparityCuda/CMakeFiles/AppStereoDisparityCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/NvOFBase/NvOF.cpp.o
[ 75%] Building CXX object AppStereoDisparityCuda/CMakeFiles/AppStereoDisparityCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/NvOFBase/NvOFCuda.cpp.o
[ 81%] Building CXX object AppStereoDisparityCuda/CMakeFiles/AppStereoDisparityCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/Utils/NvOFUtilsCuda.cpp.o
[ 87%] Building CXX object AppStereoDisparityCuda/CMakeFiles/AppStereoDisparityCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/Utils/NvOFUtils.cpp.o
[ 93%] Building CXX object AppStereoDisparityCuda/CMakeFiles/AppStereoDisparityCuda.dir/home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/Utils/NvOFDataLoader.cpp.o
[100%] Linking CXX executable AppStereoDisparityCuda
[100%] Built target AppStereoDisparityCuda
taylor@twisted-desktop:~/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build$ sudo make install
-- FreeImage include dir : /usr/include
-- FreeImage lib dir : /usr/lib/x86_64-linux-gnu/libfreeimage.so
cuda lib: /usr/lib/x86_64-linux-gnu/libcuda.so
cuda include: /usr/local/cuda/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/taylor/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build
[  6%] Linking CXX executable AppOFCuda
[ 50%] Built target AppOFCuda
[ 56%] Linking CXX executable AppStereoDisparityCuda
[100%] Built target AppStereoDisparityCuda
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/bin/x64/AppOFCuda
-- Installing: /usr/local/bin/x64/AppStereoDisparityCuda
taylor@twisted-desktop:~/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build$ /usr/local/bin/x64/AppOFCuda --input=/home/taylor/Pictures/photogrammetry/frames/PANA3638/PANA*.png --output=/home/taylor/Pictures/photogrammetry/frames/output
GPU in use: GeForce RTX 2080 Ti
DoInit : m_NvOFAPI->GetAPI()->nvOFInit(m_NvOFAPI->GetHandle(), &initParams)returned error 5 at /home/taylor/Software/Optical_Flow_SDK_3.0.15/Common/NvOFBase/NvOFCuda.cpp;120

taylor@twisted-desktop:~/Software/Optical_Flow_SDK_3.0.15/NvOFBasicSamples/build$

Any help would be appreciated. Thank you!

Are your images under 4Kx4K resolution?

Good question! They are not, they are 5184 x 3456. I guess I missed the resolution limitation, but I will reduce the resolution and try again thank you.

Reducing the resolution did it.

I wish the program said “Image too large” rather than “m_NvOFAPI->GetAPI()->nvOFInit(m_NvOFAPI->GetHandle(), &initParams)returned error 5”

I tried to figure out what Error 5 was and I guess I failed because if I’d seen “image size” there I would have tried that.

Thanks for the help!