Rpcs3: Problem compiling Vulkan on Linux

Created on 1 Oct 2016  Â·  20Comments  Â·  Source: RPCS3/rpcs3

/home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp: In instantiation of ‘VKGSRender::upload_vertex_data()::<lambda(const auto:3&, const auto:4&)> [with auto:3 = rsx::rsx_state; auto:4 = std::vector<std::pair<unsigned int, unsigned int> >]’: /usr/include/c++/5/type_traits:2346:26: required by substitution of ‘template<class _Fn, class ... _Args> static std::__success_type<decltype (declval<_Fn>()((declval<_Args>)()...))> std::__result_of_other_impl::_S_test(int) [with _Fn = VKGSRender::upload_vertex_data()::<lambda(const auto:3&, const auto:4&)>; _Args = {const rsx::rsx_state&, const std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int> > >&}]’ /usr/include/c++/5/type_traits:2357:55: required from ‘struct std::__result_of_impl<false, false, VKGSRender::upload_vertex_data()::<lambda(const auto:3&, const auto:4&)>, const rsx::rsx_state&, const std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int> > >&>’ /usr/include/c++/5/type_traits:2361:12: required from ‘class std::result_of<VKGSRender::upload_vertex_data()::<lambda(const auto:3&, const auto:4&)>(const rsx::rsx_state&, const std::vector<std::pair<unsigned int, unsigned int> >&)>’ /usr/include/c++/5/functional:2053:9: required by substitution of ‘template<class _Functor, class, class> std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = VKGSRender::upload_vertex_data()::<lambda(const auto:3&, const auto:4&)>; <template-parameter-1-2> = void; <template-parameter-1-3> = <missing>]’ /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:560:92: required from here /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:560:91: error: cannot call member function ‘std::vector<std::variant<rsx::vertex_array_buffer, rsx::vertex_array_register, rsx::empty_vertex_array> > rsx::thread::get_vertex_buffers(const rsx::rsx_state&, const std::vector<std::pair<unsigned int, unsigned int> >&) const’ without object auto& state, const auto& range) { return get_vertex_buffers(state, range); }); ^ /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp: In member function ‘std::tuple<VkPrimitiveTopology, unsigned int, std::optional<std::tuple<long unsigned int, VkIndexType> > > VKGSRender::upload_vertex_data()’: /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:560:92: error: no matching function for call to ‘{anonymous}::draw_command_visitor::draw_command_visitor(vk::render_device&, vk::vk_data_heap&, vk::vk_data_heap&, vk::glsl::program*&, VkDescriptorSet_T*&, std::vector<std::unique_ptr<vk::buffer_view> >&, VKGSRender::upload_vertex_data()::<lambda(const auto:3&, const auto:4&)>)’ auto& state, const auto& range) { return get_vertex_buffers(state, range); }); ^ /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:353:3: note: candidate: {anonymous}::draw_command_visitor::draw_command_visitor(VkDevice, vk::vk_data_heap&, vk::vk_data_heap&, vk::glsl::program*, VkDescriptorSet, std::vector<std::unique_ptr<vk::buffer_view> >&, std::function<std::vector<std::variant<rsx::vertex_array_buffer, rsx::vertex_array_register, rsx::empty_vertex_array> >(const rsx::rsx_state&, const std::vector<std::pair<unsigned int, unsigned int> >&)>) draw_command_visitor(VkDevice device, vk::vk_data_heap& index_buffer_ring_inf ^ /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:353:3: note: no known conversion for argument 7 from ‘VKGSRender::upload_vertex_data()::<lambda(const auto:3&, const auto:4&)>’ to ‘std::function<std::vector<std::variant<rsx::vertex_array_buffer, rsx::vertex_array_register, rsx::empty_vertex_array> >(const rsx::rsx_state&, const std::vector<std::pair<unsigned int, unsigned int> >&)>’ /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:348:9: note: candidate: {anonymous}::draw_command_visitor::draw_command_visitor(const {anonymous}::draw_command_visitor&) struct draw_command_visitor ^ /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:348:9: note: candidate expects 1 argument, 7 provided /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:348:9: note: candidate: {anonymous}::draw_command_visitor::draw_command_visitor({anonymous}::draw_command_visitor&&) /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:348:9: note: candidate expects 1 argument, 7 provided rpcs3/CMakeFiles/rpcs3.dir/build.make:2676: recipe for target 'rpcs3/CMakeFiles/rpcs3.dir/Emu/RSX/VK/VKVertexBuffers.cpp.o' failed

While working to bring Vulkan rpcs3 on Linux i came across this compiling error. This is on Ubuntu 16.04. Compiler is gcc 5.4.

Linux Vulkan

Most helpful comment

@rcaridade145 your vulkan fork builds fine with clang on Archlinux, and also works

screenshot_20161021_095410

The only issue i noticed that FPS meter doesn't work in both Vulkan and OpenGL, and also in Vulkan i can't input anything (keyboard doesn't work, so i can't check ingame)

All 20 comments

Well, Travis doesn't compile VK renderer... I have no idea how to fix weird dependencies.

IIRC, Vulkan doesn't have cross-platform windowing abstractions, so this code is windows only for now. If you won't it to port it to linux, I think @kd-11 might help you with this.
p.s. not sure if it's related to the error you've listed, since it's hard to parse ;P

@danilaml I'm adding them :)

Basically clang and gcc on my machine don't understand /Emu/RSX/VK/VKVertexBuffers.cpp:348:9: note: candidate: {anonymous}::draw_command_visitor::draw_command_visitor(const {anonymous}::draw_command_visitor&) struct draw_command_visitor ^ /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:348:9: note: candidate expects 1 argument, 7 provided /home/rui/Programacao/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp:348:9 .

Vulkan doesn't have cross-platform windowing abstractions

@danilaml What about Vulkan WSI? https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#wsi

@Sunderland93 As you can see in your link, it still requires platform-specific code for creating a surface. And it's not even platform-specific, rather windows manager specific. Also, rpcs3 adopted Vulkan rather early, so linux side of things was highly experimental at the time. Anyway, I really think that @kd-11 can be of more help.

@rcaridade145 https://ci.appveyor.com/project/rpcs3/rpcs3/build/1.0.3469#L852
MSVC compiler also doesn't like that block very much, but the same is true for ogl and dx12 backends. Maybe getting rid of the type conversion warnings might allow compilation to proceed?
By the way, just get the linux version to compile on travis and start without hard crashing and we can clean up any graphical/runtime bugs later.

@kd-11 Maybe i can help with the Linux side of things on Travis. Where can i find the building log? I have successfully build it on Linux (https://github.com/RPCS3/rpcs3/issues/1752#issuecomment-241230256).
All the best.

If you have travis set up on your repository, it'll build automatically every time you push commits.

@rcaridade145, I suggest then forking and amending .travis.yml to use clang over gcc. I've been trying to get a build done here for Debian systems, but haven't had much luck yet. I'll likely do the same for my fork to just keep an eye on things.

@ProfessorKaos64
It seems clang++ does not allow "std::unordered_map m_render_targets_storage = {};" More info can be found here http://stackoverflow.com/a/17264506 . TLDR : You need to explicit declare it.
Concerning the lack of llvm detection that comes from a problem with how LLVM is packaged on Debian/Ubuntu . On my desktop i got around this by doing the sugested "ops" here https://github.com/iovisor/bcc/issues/492 .
All the best

Looks like radv got merged, so I should be able to assist with this soon.

After a bit of googling it seems that the problem is with gcc itself ( the error being http://stackoverflow.com/questions/1127738/cannot-call-member-function-without-object). With clang i was able to build Vulkan under linux (after some issues with casing VkTextOut on Linux is different from VKTextOut).
Now i do however get

F LDR: St13runtime_error thrown: Assertion failed! Result is FFFFFFFAh

Bad compile? Something missing?

That's a driver/loader return code, so progress.

Return code is LAYER_NOT_PRESENT. Disable debug output and see if it helps.

@rcaridade145 your vulkan fork builds fine with clang on Archlinux, and also works

screenshot_20161021_095410

The only issue i noticed that FPS meter doesn't work in both Vulkan and OpenGL, and also in Vulkan i can't input anything (keyboard doesn't work, so i can't check ingame)

Thank you for testing that @Nezarn . For all accounts it should be working also on Ubuntu (Nvidia card) but i seem to be hitting a bug somewhere.@Nezarn what GFX do you have. Thank you for your input on the fps and keyboard. Will take a look at it this weekend.

@rcaridade145 I have an AMD RX480, and I use AMDGPU-Pro driver.

edit: also a tip, if you installed vulkan drivers for your nvidia card and it still doesn't work, you need to remove the intel_icd.json (i think this is what its called) file if you have it.

Return code is LAYER_NOT_PRESENT. Disable debug output and see if it helps

If fact it was :) Disabled LUNARG and got a screen :)

vulkan

Now onto the other bugs :) @Nezarn mentioned

@rcaridade145 Submit this as a pull request so we can get it into master. Remaining issues can be fixed afterwards.

Solved by #2842

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LokiGrants picture LokiGrants  Â·  3Comments

uaqlover picture uaqlover  Â·  3Comments

altiereslima picture altiereslima  Â·  3Comments

On1ko picture On1ko  Â·  3Comments

xiangzhai picture xiangzhai  Â·  3Comments