Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kompute support for newer Vulkan HPP headers #81

Closed
Kezii opened this issue Oct 31, 2020 · 9 comments · Fixed by #83
Closed

Kompute support for newer Vulkan HPP headers #81

Kezii opened this issue Oct 31, 2020 · 9 comments · Fixed by #83
Assignees

Comments

@Kezii
Copy link

Kezii commented Oct 31, 2020

OS: Arch Linux x86_64
cmake version 3.18.4

> pacman -Qi vulkan-headers
Name            : vulkan-headers
Version         : 1:1.2.157-1
> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC) 

> make
/usr/bin/cmake -S/tmp/vulkan-kompute -B/tmp/vulkan-kompute/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /tmp/vulkan-kompute/build/CMakeFiles /tmp/vulkan-kompute/build//CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/tmp/vulkan-kompute/build'
make  -f src/CMakeFiles/kompute.dir/build.make src/CMakeFiles/kompute.dir/depend
make[2]: Entering directory '/tmp/vulkan-kompute/build'
cd /tmp/vulkan-kompute/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/vulkan-kompute /tmp/vulkan-kompute/src /tmp/vulkan-kompute/build /tmp/vulkan-kompute/build/src /tmp/vulkan-kompute/build/src/CMakeFiles/kompute.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/tmp/vulkan-kompute/build'
make  -f src/CMakeFiles/kompute.dir/build.make src/CMakeFiles/kompute.dir/build
make[2]: Entering directory '/tmp/vulkan-kompute/build'
[ 11%] Building CXX object src/CMakeFiles/kompute.dir/Algorithm.cpp.o
cd /tmp/vulkan-kompute/build/src && /usr/bin/c++  -I/tmp/vulkan-kompute/src/include -std=gnu++14 -o CMakeFiles/kompute.dir/Algorithm.cpp.o -c /tmp/vulkan-kompute/src/Algorithm.cpp
/tmp/vulkan-kompute/src/Algorithm.cpp: In destructor 'kp::Algorithm::~Algorithm()':
/tmp/vulkan-kompute/src/Algorithm.cpp:37:48: error: call of overloaded 'destroy(std::__shared_ptr_access<vk::Pipeline, __gnu_cxx::_S_atomic, false, false>::element_type&)' is ambiguous
   37 |         this->mDevice->destroy(*this->mPipeline);
      |                                                ^
In file included from /tmp/vulkan-kompute/src/include/kompute/Core.hpp:11,
                 from /tmp/vulkan-kompute/src/include/kompute/Algorithm.hpp:3,
                 from /tmp/vulkan-kompute/src/Algorithm.cpp:3:
/usr/include/vulkan/vulkan.hpp:84413:26: note: candidate: 'void vk::Device::destroy(vk::Pipeline, const vk::AllocationCallbacks*, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84413 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Pipeline pipeline, const VULKAN_HPP_NAMESPACE::AllocationCallbacks* pAllocator, Dispatch const & d  ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/usr/include/vulkan/vulkan.hpp:84420:26: note: candidate: 'void vk::Device::destroy(vk::Pipeline, vk::Optional<const vk::AllocationCallbacks>, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84420 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Pipeline pipeline, Optional<const AllocationCallbacks> allocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/tmp/vulkan-kompute/src/Algorithm.cpp:46:53: error: call of overloaded 'destroy(std::__shared_ptr_access<vk::PipelineCache, __gnu_cxx::_S_atomic, false, false>::element_type&)' is ambiguous
   46 |         this->mDevice->destroy(*this->mPipelineCache);
      |                                                     ^
In file included from /tmp/vulkan-kompute/src/include/kompute/Core.hpp:11,
                 from /tmp/vulkan-kompute/src/include/kompute/Algorithm.hpp:3,
                 from /tmp/vulkan-kompute/src/Algorithm.cpp:3:
/usr/include/vulkan/vulkan.hpp:84443:26: note: candidate: 'void vk::Device::destroy(vk::PipelineCache, const vk::AllocationCallbacks*, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84443 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, const VULKAN_HPP_NAMESPACE::AllocationCallbacks* pAllocator, Dispatch const & d  ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/usr/include/vulkan/vulkan.hpp:84450:26: note: candidate: 'void vk::Device::destroy(vk::PipelineCache, vk::Optional<const vk::AllocationCallbacks>, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84450 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, Optional<const AllocationCallbacks> allocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/tmp/vulkan-kompute/src/Algorithm.cpp:55:54: error: call of overloaded 'destroy(std::__shared_ptr_access<vk::PipelineLayout, __gnu_cxx::_S_atomic, false, false>::element_type&)' is ambiguous
   55 |         this->mDevice->destroy(*this->mPipelineLayout);
      |                                                      ^
In file included from /tmp/vulkan-kompute/src/include/kompute/Core.hpp:11,
                 from /tmp/vulkan-kompute/src/include/kompute/Algorithm.hpp:3,
                 from /tmp/vulkan-kompute/src/Algorithm.cpp:3:
/usr/include/vulkan/vulkan.hpp:84473:26: note: candidate: 'void vk::Device::destroy(vk::PipelineLayout, const vk::AllocationCallbacks*, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84473 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout, const VULKAN_HPP_NAMESPACE::AllocationCallbacks* pAllocator, Dispatch const & d  ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/usr/include/vulkan/vulkan.hpp:84480:26: note: candidate: 'void vk::Device::destroy(vk::PipelineLayout, vk::Optional<const vk::AllocationCallbacks>, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84480 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout, Optional<const AllocationCallbacks> allocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/tmp/vulkan-kompute/src/Algorithm.cpp:64:52: error: call of overloaded 'destroy(std::__shared_ptr_access<vk::ShaderModule, __gnu_cxx::_S_atomic, false, false>::element_type&)' is ambiguous
   64 |         this->mDevice->destroy(*this->mShaderModule);
      |                                                    ^
In file included from /tmp/vulkan-kompute/src/include/kompute/Core.hpp:11,
                 from /tmp/vulkan-kompute/src/include/kompute/Algorithm.hpp:3,
                 from /tmp/vulkan-kompute/src/Algorithm.cpp:3:
/usr/include/vulkan/vulkan.hpp:84697:26: note: candidate: 'void vk::Device::destroy(vk::ShaderModule, const vk::AllocationCallbacks*, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84697 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, const VULKAN_HPP_NAMESPACE::AllocationCallbacks* pAllocator, Dispatch const & d  ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/usr/include/vulkan/vulkan.hpp:84704:26: note: candidate: 'void vk::Device::destroy(vk::ShaderModule, vk::Optional<const vk::AllocationCallbacks>, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84704 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, Optional<const AllocationCallbacks> allocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/tmp/vulkan-kompute/src/Algorithm.cpp:83:59: error: call of overloaded 'destroy(std::__shared_ptr_access<vk::DescriptorSetLayout, __gnu_cxx::_S_atomic, false, false>::element_type&)' is ambiguous
   83 |         this->mDevice->destroy(*this->mDescriptorSetLayout);
      |                                                           ^
In file included from /tmp/vulkan-kompute/src/include/kompute/Core.hpp:11,
                 from /tmp/vulkan-kompute/src/include/kompute/Algorithm.hpp:3,
                 from /tmp/vulkan-kompute/src/Algorithm.cpp:3:
/usr/include/vulkan/vulkan.hpp:84144:26: note: candidate: 'void vk::Device::destroy(vk::DescriptorSetLayout, const vk::AllocationCallbacks*, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84144 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout, const VULKAN_HPP_NAMESPACE::AllocationCallbacks* pAllocator, Dispatch const & d  ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/usr/include/vulkan/vulkan.hpp:84151:26: note: candidate: 'void vk::Device::destroy(vk::DescriptorSetLayout, vk::Optional<const vk::AllocationCallbacks>, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84151 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout, Optional<const AllocationCallbacks> allocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/tmp/vulkan-kompute/src/Algorithm.cpp:92:54: error: call of overloaded 'destroy(std::__shared_ptr_access<vk::DescriptorPool, __gnu_cxx::_S_atomic, false, false>::element_type&)' is ambiguous
   92 |         this->mDevice->destroy(*this->mDescriptorPool);
      |                                                      ^
In file included from /tmp/vulkan-kompute/src/include/kompute/Core.hpp:11,
                 from /tmp/vulkan-kompute/src/include/kompute/Algorithm.hpp:3,
                 from /tmp/vulkan-kompute/src/Algorithm.cpp:3:
/usr/include/vulkan/vulkan.hpp:84114:26: note: candidate: 'void vk::Device::destroy(vk::DescriptorPool, const vk::AllocationCallbacks*, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84114 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, const VULKAN_HPP_NAMESPACE::AllocationCallbacks* pAllocator, Dispatch const & d  ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/usr/include/vulkan/vulkan.hpp:84121:26: note: candidate: 'void vk::Device::destroy(vk::DescriptorPool, vk::Optional<const vk::AllocationCallbacks>, const Dispatch&) const [with Dispatch = vk::DispatchLoaderStatic]'
84121 |   VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, Optional<const AllocationCallbacks> allocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT
      |                          ^~~~~~
/tmp/vulkan-kompute/src/Algorithm.cpp: In member function 'void kp::Algorithm::createPipeline(std::vector<unsigned int>)':
/tmp/vulkan-kompute/src/Algorithm.cpp:277:79: warning: 'vk::ResultValue<T>::operator T&&() && [with T = vk::Pipeline]' is deprecated: Implicit-cast operators on vk::ResultValue are deprecated. Explicitly access the value as member of ResultValue. [-Wdeprecated-declarations]
  277 |       this->mDevice->createComputePipeline(*this->mPipelineCache, pipelineInfo);
      |                                                                               ^
In file included from /tmp/vulkan-kompute/src/include/kompute/Core.hpp:11,
                 from /tmp/vulkan-kompute/src/include/kompute/Algorithm.hpp:3,
                 from /tmp/vulkan-kompute/src/Algorithm.cpp:3:
/usr/include/vulkan/vulkan.hpp:14051:5: note: declared here
14051 |     operator T&& () && VULKAN_HPP_NOEXCEPT
      |     ^~~~~~~~
make[2]: *** [src/CMakeFiles/kompute.dir/build.make:85: src/CMakeFiles/kompute.dir/Algorithm.cpp.o] Error 1
make[2]: Leaving directory '/tmp/vulkan-kompute/build'
make[1]: *** [CMakeFiles/Makefile2:116: src/CMakeFiles/kompute.dir/all] Error 2
make[1]: Leaving directory '/tmp/vulkan-kompute/build'
make: *** [Makefile:152: all] Error 2

@axsaucedo axsaucedo self-assigned this Oct 31, 2020
@axsaucedo
Copy link
Member

axsaucedo commented Oct 31, 2020

Thank you for reporting @Kezii. From the error it seems like it may be related to the version of the headers and API, there are some build parameters that could help, similar to the solution for #67.

EDIT: I've been able to replicate, update below.

The above seems to be specific to the result value component through the flag KOMPUTE_CREATE_PIPELINE_RESULT_VALUE.

You can also ensure you set the Vulkan API version on the compile flags here https://github.com/EthicalML/vulkan-kompute#compile-flags

Concurrently I will try to rerun a build with that environment using the version 1.1x headers to try to replicate.

@axsaucedo
Copy link
Member

@Kezii I've been able to replicate the issue, and I can confirm it's due to a small breaking change in a recent version of VulkanHPP headers. I can confirm that it works with version 1.2.154 and below. I am now working in an update that will introduce backwards compatibility via a build flag. Just as a heads up, the default will still be aligned with the default headers provided with the Vulkan SDK install, which at the time of writing these are version 1.2.48 - this is the reason why the issue didn't arise previously.

@axsaucedo
Copy link
Member

@Kezii this should now have been fixed via PR #83, I will re-open this issue so we can confirm that this has fixed it for you as well. If you can give it a try, this should tell us whether it's been addressed for your case, as you're using Vulkan Headers version 1.2.158.

@axsaucedo axsaucedo reopened this Nov 1, 2020
@Kezii
Copy link
Author

Kezii commented Nov 1, 2020

The issue is solved, I made an AUR package for this project

https://aur.archlinux.org/packages/vulkan-kompute-git/

@Kezii Kezii closed this as completed Nov 1, 2020
@axsaucedo
Copy link
Member

That's awesome! Thank you @Kezii - I'll add this to the main documentation, if you have the scripts to keep the AUR package up to date I would also be very keen to add them so they are run with every release (planning to do a release today with these fixes)

@Kezii
Copy link
Author

Kezii commented Nov 1, 2020

Hello,
The aur package pulls automatically the latest commit, a stable package can be made and in that case it has to be updated manually, users are able to flag out of date packages.

If you use arch I can put you as a maintainer or transfer ownership, otherwise for now I think the -git package is sufficient, no maintenance is required unless there are new dependencies, etc.

If the package breaks it's my fault, users are generally aware of this, they won't come after you 😄
Users are also aware of the fact that -git packages are compiled from git master.

If you want to review the packaging process, it's here https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vulkan-kompute-git inside the build() and package() function

For the documentation, the library can now be installed in Archlinux (and derivatives) with an aur helper like

paru -S vulkan-kompute-git

Thank you for developing this library

@axsaucedo
Copy link
Member

Thank you for the explanation @Kezii - that sounds great. Ok in that case I will get registered and will provide you the details, but id does sound like it's bound to the github repo which does make it quite maintainable. Great idea.

Thanks to you for contributing and supporting!

@axsaucedo axsaucedo changed the title kompute doesn't build Kompute support for newer Vulkan HPP headers Nov 1, 2020
@Kezii
Copy link
Author

Kezii commented Nov 2, 2020

id does sound like it's bound to the github repo which does make it quite maintainable. Great idea.

Yeah sorry if that wasn't clear, there is no copy of the code anywhere, the script just packages stuff downloading it from the main repo, in its current form it requires no maintenance and it's easier for Arch (and derivatives) users to install this library

Thank you again

@axsaucedo
Copy link
Member

@Kezii good shout on reporting this issue, it seems like they ended up addressing it upstream from Vulkan HPP 1.2.159+ to still ensure backwards compatibility KhronosGroup/Vulkan-Hpp#814 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants