Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
stitchEm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Franco (nextime) Lanza
stitchEm
Commits
45cdaf3c
Commit
45cdaf3c
authored
Apr 26, 2019
by
jerem
Committed by
jeremad
Feb 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix openCL and CUDA from ubuntu
parent
a3d5481f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
29 deletions
+29
-29
CUDA.cmake
cmake/CUDA.cmake
+3
-4
CMakeLists.txt
discovery/CMakeLists.txt
+7
-11
BUILD.md
doc/BUILD.md
+5
-1
base.dockerfile
docker/base.dockerfile
+5
-1
ci.dockerfile
docker/ci.dockerfile
+1
-1
libvideostitch_CUDA.cmake
lib/libvideostitch_CUDA.cmake
+3
-3
libvideostitch_OpenCL.cmake
lib/libvideostitch_OpenCL.cmake
+4
-7
CMakeLists.txt
lib/src/backend/cl/CMakeLists.txt
+1
-1
No files found.
cmake/CUDA.cmake
View file @
45cdaf3c
...
...
@@ -31,20 +31,19 @@ if (WINDOWS)
find_library
(
NVML nvml PATHS
"
${
CUDA_TOOLKIT_ROOT_DIR
}
/lib/x64"
NO_DEFAULT_PATH
)
endif
(
WINDOWS
)
if
(
LINUX
)
if
(
LINUX
)
set
(
CUDA_PROPAGATE_HOST_FLAGS
"FALSE"
)
if
(
TEGRA_DEMO
)
set
(
LINUX_CUDA_PATH
${
CUDA_TOOLKIT_TARGET_DIR
}
/lib
)
find_library
(
GLEW_LIBRARIES GLEW NO_CMAKE_FIND_ROOT_PATH
)
find_library
(
OPENGL_LIBRARIES GL NO_CMAKE_FIND_ROOT_PATH
)
else
(
TEGRA_DEMO
)
else
()
find_package
(
GLEW
)
find_library
(
CUDA cuda PATHS
"
${
LINUX_CUDA_PATH
}
/stubs"
)
find_library
(
CUDART cudart PATHS
${
LINUX_CUDA_PATH
}
)
find_library
(
NVML nvidia-ml PATHS
"
${
LINUX_CUDA_PATH
}
/stubs"
)
endif
(
TEGRA_DEMO
)
endif
()
include_directories
(
${
CMAKE_EXTERNAL_DEPS
}
/include
)
link_directories
(
${
LINUX_CUDA_PATH
}
)
find_library
(
CUVID nvcuvid
)
endif
(
LINUX
)
...
...
discovery/CMakeLists.txt
View file @
45cdaf3c
...
...
@@ -50,19 +50,16 @@ include_discovery_vs_headers(${VS_DISCOVERY})
if
(
NOT ANDROID
)
find_package
(
OpenCL
)
endif
(
NOT ANDROID
)
if
(
OpenCL_FOUND
)
endif
(
)
if
(
OpenCL_FOUND
AND GPU_BACKEND_OPENCL
)
target_include_directories
(
${
VS_DISCOVERY
}
PRIVATE
${
OpenCL_INCLUDE_DIRS
}
)
target_link_libraries
(
${
VS_DISCOVERY
}
PUBLIC
${
OpenCL_LIBRARY
}
)
# different names on different implementations of find_package(OpenCL)
set
(
PLATFORM_INDEPENDENT_OPENCL_LIBS
${
OpenCL_LIBRARIES
}
${
OPENCL_LIBRARIES
}
)
target_link_libraries
(
${
VS_DISCOVERY
}
PRIVATE
${
PLATFORM_INDEPENDENT_OPENCL_LIBS
}
)
if
(
MSVC
)
target_link_libraries
(
${
VS_DISCOVERY
}
PUBLIC
${
OpenCL_LIBRARIES
}
)
if
(
WINDOWS
)
target_link_libraries
(
${
VS_DISCOVERY
}
PRIVATE
"DelayImp.lib"
)
set_target_properties
(
${
VS_DISCOVERY
}
PROPERTIES LINK_FLAGS
"/DELAYLOAD:OpenCL.dll"
)
endif
(
MSVC
)
endif
()
target_compile_definitions
(
${
VS_DISCOVERY
}
PRIVATE OPENCL_FOUND
)
endif
(
OpenCL_FOUND
)
endif
()
# ----------------------------------------------------------------------------
# CUDA
...
...
@@ -71,7 +68,7 @@ endif(OpenCL_FOUND)
if
(
NOT CUDA_FOUND
)
include
(
${
CMAKE_SOURCE_DIR
}
/cmake/getCuda.cmake
)
endif
(
NOT CUDA_FOUND
)
if
(
CUDA_FOUND
)
if
(
CUDA_FOUND
)
target_include_directories
(
${
VS_DISCOVERY
}
PRIVATE
${
CUDA_INCLUDE_DIRS
}
)
target_link_libraries
(
${
VS_DISCOVERY
}
PRIVATE
${
CUDA_LIBRARIES
}
)
target_compile_definitions
(
${
VS_DISCOVERY
}
PRIVATE CUDA_FOUND
)
...
...
@@ -136,4 +133,3 @@ if(STAGING)
else
()
add_test
(
NAME
${
DEVICE_NAME_TEST
}
COMMAND
${
DEVICE_NAME_TEST
}
)
endif
()
doc/BUILD.md
View file @
45cdaf3c
...
...
@@ -58,11 +58,15 @@ sudo apt install
libturbojpeg0-dev \
libx264-dev \
ninja-build \
ocl-icd-opencl-dev \
opencl-headers \
portaudio19-dev \
qt5-default \
qtmultimedia5-dev \
qttools5-dev \
swig
swig \
wget \
xxd
# Set up gcc-6 and g++-6 as your compiler
sudo apt-get install gcc-6 g++-6
...
...
docker/base.dockerfile
View file @
45cdaf3c
...
...
@@ -5,6 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
bison \
ccache \
clang \
doxygen \
flex \
git \
...
...
@@ -22,13 +23,16 @@ RUN apt update && apt install -y \
librtmp-dev \
libx264-dev \
ninja-build \
ocl-icd-opencl-dev \
opencl-headers \
portaudio19-dev \
python-pip \
qt5-default \
qtmultimedia5-dev \
qttools5-dev \
swig \
wget
wget \
xxd
RUN pip install cmake
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
RUN apt-key add 7fa2af80.pub
...
...
docker/ci.dockerfile
View file @
45cdaf3c
...
...
@@ -5,5 +5,5 @@ ADD . stitchEm
WORKDIR stitchEm
RUN echo ${CUDA_SHORT} > cuda.version
WORKDIR build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DRTMP_NVENC=OFF -DCUDA_TARGET_ARCH="50" -G Ninja ..
RUN cmake -DCMAKE_BUILD_TYPE=Release -DRTMP_NVENC=OFF -DCUDA_TARGET_ARCH="50" -
DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=OFF -DDISABLE_OPENCL_SPIR=ON -
G Ninja ..
CMD ninja
lib/libvideostitch_CUDA.cmake
View file @
45cdaf3c
...
...
@@ -148,9 +148,9 @@ if(ANDROID)
vs_lib_link_libraries
(
"CUDA"
${
GLEW
}
log
)
message
(
STATUS
"CUDA_LIBRARIES =
${
CUDA_LIBRARIES
}
"
)
else
()
vs_lib_link_libraries
(
"
PUBLIC_CUDA"
${
CUDART
}
${
CUDA_LIBRARIES
}
${
NVTX
}
)
vs_lib_link_libraries
(
"
CUDA"
${
CUDART
}
${
NVTX
}
)
vs_lib_link_libraries
(
"CUDA"
${
OpenGL
}
${
OPENGL_LIBRARIES
}
${
GLEW_LIBRARIES
}
${
GLEW
}
)
vs_lib_link_libraries
(
"PUBLIC_CUDA"
${
NVML
}
)
vs_lib_link_libraries
(
"PUBLIC_CUDA"
${
NVML
}
${
CUDA_LIBRARIES
}
)
if
(
CMAKE_CROSSCOMPILING
)
# needed by ceres
vs_lib_link_libraries
(
"CUDA"
-fopenmp
)
...
...
@@ -161,5 +161,5 @@ else()
else
()
vs_lib_link_libraries
(
"PUBLIC_CUDA"
${
CUDA
}
)
endif
()
endif
(
ANDROID
)
endif
()
lib/libvideostitch_OpenCL.cmake
View file @
45cdaf3c
option
(
DISABLE_OPENCL_SPIR
"Skip OpenCL offline compilation and ship kernel sources"
)
option
(
CL_ARGS_WORKAROUND
"Redefining functions to support OpenCL limitation in parameters format"
)
if
(
DISABLE_OPENCL_SPIR
)
message
(
WARNING
"Careful: OpenCL offline compilation disabled. Binary will contain all OpenCL kernel sources as plain text!"
)
else
(
DISABLE_OPENCL_SPIR
)
if
(
NOT DISABLE_OPENCL_SPIR
)
if
(
LINUX OR ANDROID
)
message
(
"No Alternative OpenCL SPIR compiler for Linux"
)
else
(
LINUX OR ANDROID
)
else
()
option
(
ALTERNATIVE_OPENCL_SPIR
"GENERATE an alternative SPIR that will be used if something goes wrong with the main SPIR"
ON
)
endif
(
LINUX OR ANDROID
)
endif
(
DISABLE_OPENCL_SPIR
)
endif
()
endif
()
set
(
CL_BACKEND_SOURCES
src/backend/cl/bilateral/bilateral.cpp
...
...
@@ -92,7 +90,6 @@ add_cppcheck(${VS_LIB_OBJECTS_OPENCL} VS)
# Add compile definitions
# ----------------------------------------------------------------------------
if
(
DISABLE_OPENCL_SPIR
)
message
(
WARNING
"Careful: OpenCL offline compilation disabled. Binary will contain all OpenCL kernel sources as plain text!"
)
target_compile_definitions
(
${
VS_LIB_OBJECTS_OPENCL
}
PRIVATE
"DISABLE_OPENCL_SPIR"
)
endif
()
if
(
CL_ARGS_WORKAROUND
)
...
...
lib/src/backend/cl/CMakeLists.txt
View file @
45cdaf3c
...
...
@@ -47,7 +47,7 @@ set(VS_LIB_ROOT_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
if
(
APPLE
)
find_program
(
OPENCL_OFFLINE_COMPILER openclc
PATHS
${
OpenCL_LIBRAR
Y
}
/Libraries/
PATHS
${
OpenCL_LIBRAR
IES
}
/Libraries/
/System/Library/Frameworks/OpenCL.framework/Libraries
DOC
"OpenCL offline compiler to build spir files from kernel sources"
)
if
(
ALTERNATIVE_OPENCL_SPIR
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment