RayTracingInVulkan icon indicating copy to clipboard operation
RayTracingInVulkan copied to clipboard

Can not compile on Ubuntu 22.04

Open yhojann-cl opened this issue 3 years ago • 3 comments

Can not compile, my hardware is AMD Radeon RX 6800 XT on Ubuntu 22.04 LTS using native amdgpu driver:

$ gcc -v;
...
gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1)
$ git clone https://github.com/GPSnoopy/RayTracingInVulkan; cd RayTracingInVulkan/;
$ apt -y install curl unzip tar libxi-dev libxinerama-dev libxcursor-dev xorg-dev;
$ ./vcpkg_linux.sh
$ ./build_linux.sh
...
CMake Warning at /usr/share/cmake-3.22/Modules/FindBoost.cmake:1369 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindBoost.cmake:1492 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.22/Modules/FindBoost.cmake:2102 (_Boost_MISSING_DEPENDENCIES)
  build/vcpkg.linux/installed/x64-linux/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
  build/vcpkg.linux/scripts/buildsystems/vcpkg.cmake:778 (include)
  CMakeLists.txt:50 (find_package)

CMake Warning at /usr/share/cmake-3.22/Modules/FindBoost.cmake:1369 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindBoost.cmake:1492 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.22/Modules/FindBoost.cmake:2102 (_Boost_MISSING_DEPENDENCIES)
  build/vcpkg.linux/installed/x64-linux/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
  build/vcpkg.linux/scripts/buildsystems/vcpkg.cmake:778 (include)
  CMakeLists.txt:50 (find_package)

CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.22/Modules/FindVulkan.cmake:129 (find_package_handle_standard_args)
  build/vcpkg.linux/scripts/buildsystems/vcpkg.cmake:824 (_find_package)
  CMakeLists.txt:56 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/.../Descargas/RayTracingInVulkan/build/linux/CMakeFiles/CMakeOutput.log".

Output log: CMakeOutput.log

yhojann-cl avatar Jun 20 '22 00:06 yhojann-cl

It looks like you need to install the Vulkan SDK: https://vulkan.lunarg.com/sdk/home. See the Ubuntu package tab.

GPSnoopy avatar Jun 20 '22 08:06 GPSnoopy

Thanks, now compile fine. Please, add the instruction on readme.md. But, can not start:

$ inxi -CG
CPU:
  Info: 8-core model: AMD Ryzen 7 5800X3D bits: 64 type: MT MCP cache:
    L2: 4 MiB
  Speed (MHz): avg: 2982 min/max: 2200/4549 cores: 1: 3127 2: 2879 3: 2879
    4: 2875 5: 2875 6: 3598 7: 2878 8: 2874 9: 2877 10: 2878 11: 2878 12: 2879
    13: 2876 14: 3589 15: 2879 16: 2879
Graphics:
  Device-1: AMD Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] driver: amdgpu
    v: kernel
  Display: wayland server: X.Org v: 1.22.1.1 with: Xwayland v: 22.1.1
    compositor: gnome-shell v: 42.1 driver: X: loaded: amdgpu,ati
    unloaded: fbdev,modesetting,radeon,vesa gpu: amdgpu
    resolution: 1920x1080~60Hz
  OpenGL: renderer: AMD Radeon RX 6800 XT (sienna_cichlid LLVM 13.0.1 DRM
    3.42 5.15.0-39-generic)
    v: 4.6 Mesa 22.0.1
$ ./build/linux/bin/RayTracer 
Vulkan SDK Header Version: 216

Vulkan Instance Extensions: 
- VK_KHR_device_group_creation (0.0.1)
- VK_KHR_display (0.0.23)
- VK_KHR_external_fence_capabilities (0.0.1)
- VK_KHR_external_memory_capabilities (0.0.1)
- VK_KHR_external_semaphore_capabilities (0.0.1)
- VK_KHR_get_display_properties2 (0.0.1)
- VK_KHR_get_physical_device_properties2 (0.0.2)
- VK_KHR_get_surface_capabilities2 (0.0.1)
- VK_KHR_surface (0.0.25)
- VK_KHR_surface_protected_capabilities (0.0.1)
- VK_KHR_wayland_surface (0.0.6)
- VK_KHR_xcb_surface (0.0.6)
- VK_KHR_xlib_surface (0.0.6)
- VK_EXT_acquire_drm_display (0.0.1)
- VK_EXT_acquire_xlib_display (0.0.1)
- VK_EXT_debug_report (0.0.10)
- VK_EXT_direct_mode_display (0.0.1)
- VK_EXT_display_surface_counter (0.0.1)
- VK_EXT_debug_utils (0.0.2)
- VK_KHR_portability_enumeration (0.0.1)

Vulkan Instance Layers: 
- VK_LAYER_VALVE_steam_overlay_64 (1.2.136) : Steam Overlay Layer
- VK_LAYER_VALVE_steam_fossilize_32 (1.2.136) : Steam Pipeline Caching Layer
- VK_LAYER_VALVE_steam_fossilize_64 (1.2.136) : Steam Pipeline Caching Layer
- VK_LAYER_VALVE_steam_overlay_32 (1.2.136) : Steam Overlay Layer
- VK_LAYER_MESA_device_select (1.2.73) : Linux device selection layer
- VK_LAYER_LUNARG_screenshot (1.3.216) : LunarG image capture layer
- VK_LAYER_LUNARG_api_dump (1.3.216) : LunarG API dump layer
- VK_LAYER_KHRONOS_validation (1.3.216) : Khronos Validation Layer
- VK_LAYER_MESA_overlay (1.2.199) : Mesa Overlay layer
- VK_LAYER_LUNARG_monitor (1.3.216) : Execution Monitoring Layer
- VK_LAYER_KHRONOS_profiles (1.3.216) : Khronos Profiles layer
- VK_LAYER_KHRONOS_synchronization2 (1.3.216) : Khronos Synchronization2 layer
- VK_LAYER_LUNARG_gfxreconstruct (1.3.216) : GFXReconstruct Capture Layer Version 0.9.14-unknown

Vulkan Devices: 
- [29631] AMD 'AMD RADV SIENNA_CICHLID' (Discrete GPU: vulkan 1.3.204, driver radv Mesa 22.0.1 - 22.0.1)
- [0] UnknownVendor 'llvmpipe (LLVM 13.0.1, 256 bits)' (CPU: vulkan 1.2.204, driver llvmpipe Mesa 22.0.1 (LLVM 13.0.1) - 0.0.1)

FATAL: cannot find a suitable device

 0# 0x0000558627ABDBB2 in ./RayTracer
 1# 0x0000558627AC019C in ./RayTracer
 2# 0x00007F3AD2A7ED90 in /lib/x86_64-linux-gnu/libc.so.6
 3# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
 4# 0x0000558627AC9585 in ./RayTracer

yhojann-cl avatar Jun 20 '22 16:06 yhojann-cl

Unfortunately I do not have AMD hardware at hand to test this with. Could you try another Vulkan ray traced application and check if it works? E.g. Quake 2 RTX.

Otherwise, the error is thrown by SetVulkanDevice() in main.cpp defined at line 205. If you feel up for it, you can compile in debug and put some breakpoints to see why it is not picking up a suitable device.

GPSnoopy avatar Jun 20 '22 18:06 GPSnoopy

Commit 7590c27ed256b184e3bb99ee000255a93f94fb57 and its GitHub CI file show that it compiles fine on Ubuntu 22.04. As for the comment above, there isn't much the app can do if the request device/driver does not support the necessary features.

GPSnoopy avatar Apr 16 '23 16:04 GPSnoopy