Open Source Computer Vision Library
Go to file
WuZhiwen 6e3ea8b49d Merge pull request #12703 from wzw-intel:vkcom
* dnn: Add a Vulkan based backend

This commit adds a new backend "DNN_BACKEND_VKCOM" and a
new target "DNN_TARGET_VULKAN". VKCOM means vulkan based
computation library.

This backend uses Vulkan API and SPIR-V shaders to do
the inference computation for layers. The layer types
that implemented in DNN_BACKEND_VKCOM include:
Conv, Concat, ReLU, LRN, PriorBox, Softmax, MaxPooling,
AvePooling, Permute

This is just a beginning work for Vulkan in OpenCV DNN,
more layer types will be supported and performance
tuning is on the way.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/vulkan: Add FindVulkan.cmake to detect Vulkan SDK

In order to build dnn with Vulkan support, need installing
Vulkan SDK and setting environment variable "VULKAN_SDK" and
add "-DWITH_VULKAN=ON" to cmake command.

You can download Vulkan SDK from:
https://vulkan.lunarg.com/sdk/home#linux

For how to install, see
https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html
https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html
https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html
respectively for linux, windows and mac.

To run the vulkan backend, also need installing mesa driver.
On Ubuntu, use this command 'sudo apt-get install mesa-vulkan-drivers'

To test, use command '$BUILD_DIR/bin/opencv_test_dnn --gtest_filter=*VkCom*'

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/Vulkan: dynamically load Vulkan runtime

No compile-time dependency on Vulkan library.
If Vulkan runtime is unavailable, fallback to CPU path.

Use environment "OPENCL_VULKAN_RUNTIME" to specify path to your
own vulkan runtime library.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/Vulkan: Add a python script to compile GLSL shaders to SPIR-V shaders

The SPIR-V shaders are in format of text-based 32-bit hexadecimal
numbers, and inserted into .cpp files as unsigned int32 array.

* dnn/Vulkan: Put Vulkan headers into 3rdparty directory and some other fixes

Vulkan header files are copied from
https://github.com/KhronosGroup/Vulkan-Docs/tree/master/include/vulkan
to 3rdparty/include

Fix the Copyright declaration issue.

Refine OpenCVDetectVulkan.cmake

* dnn/Vulkan: Add vulkan backend tests into existing ones.

Also fixed some test failures.

- Don't use bool variable as uniform for shader
- Fix dispathed group number beyond max issue
- Bypass "group > 1" convolution. This should be support in future.

* dnn/Vulkan: Fix multiple initialization in one thread.
2018-10-29 17:51:26 +03:00
.github Merge pull request #12093 from CYTing1998:update_issue 2018-08-03 20:08:30 +03:00
3rdparty Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
apps Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-20 11:37:54 +00:00
cmake Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
data Some mist. typo fixes 2018-02-07 06:59:15 -05:00
doc Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-26 17:56:55 +03:00
include drop legacy headers 2018-09-10 08:33:16 +00:00
modules Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
platforms Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-26 17:56:55 +03:00
samples Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-26 17:56:55 +03:00
.editorconfig add .editorconfig 2018-10-11 17:57:51 +00:00
.gitattributes cmake: generate and install ffmpeg-download.ps1 2018-06-09 13:19:48 +03:00
.gitignore git: .gitignore update 2017-11-07 17:24:48 +03:00
CMakeLists.txt Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
CONTRIBUTING.md migration: github.com/opencv/opencv 2016-07-12 12:51:12 +03:00
LICENSE copyright: 2018 2018-01-16 13:55:42 +03:00
README.md Use secure URLs in README (#12160) 2018-08-31 17:09:40 +03:00

OpenCV: Open Source Computer Vision Library

Resources

Contributing

Please read the contribution guidelines before starting work on a pull request.

Summary of the guidelines:

  • One pull request per issue;
  • Choose the right base branch;
  • Include tests and documentation;
  • Clean up "oops" commits before submitting;
  • Follow the coding style guide.