Closed Camsbury closed 2 years ago
Hi, unfortunately Iced's glow backend doesn't support images yet, that's why 'svg' doesn't work.
But you can use the font-pieces-with-tabs branch, I just updated it now merging the last 2 commits from main. In that branch we use a font for the pieces (making use of the chess pieces in Unicode, which was the original design I had copied from chess-engine), it's uglier but works.
Which system do you have? Iced wgpu backend also supports DX12 if you're on Windows and if iced examples work with the wgpu backend, this project should work as well. I used to have the "GraphicsAdapterNotFound" issue when I tried to run it in a VM.
I'm running on x86_64 GNU/Linux
vulkaninfo gives
==========
VULKANINFO
==========
Vulkan Instance Version: 1.2.198
Instance Extensions: count = 18
===============================
VK_EXT_acquire_xlib_display : extension revision 1
VK_EXT_debug_report : extension revision 10
VK_EXT_debug_utils : extension revision 2
VK_EXT_direct_mode_display : extension revision 1
VK_EXT_display_surface_counter : extension revision 1
VK_KHR_device_group_creation : extension revision 1
VK_KHR_display : extension revision 23
VK_KHR_external_fence_capabilities : extension revision 1
VK_KHR_external_memory_capabilities : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2 : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2 : extension revision 1
VK_KHR_surface : extension revision 25
VK_KHR_surface_protected_capabilities : extension revision 1
VK_KHR_wayland_surface : extension revision 6
VK_KHR_xcb_surface : extension revision 6
VK_KHR_xlib_surface : extension revision 6
Layers: count = 5
=================
VK_LAYER_NV_optimus (NVIDIA Optimus layer) Vulkan version 1.3.194, layer version 1:
Layer Extensions: count = 0
Devices: count = 1
GPU id = 0 (NVIDIA TITAN X (Pascal))
Layer-Device Extensions: count = 0
VK_LAYER_VALVE_steam_fossilize_32 (Steam Pipeline Caching Layer) Vulkan version 1.2.136, layer version 1:
Layer Extensions: count = 0
Devices: count = 1
GPU id = 0 (NVIDIA TITAN X (Pascal))
Layer-Device Extensions: count = 0
VK_LAYER_VALVE_steam_fossilize_64 (Steam Pipeline Caching Layer) Vulkan version 1.2.136, layer version 1:
Layer Extensions: count = 0
Devices: count = 1
GPU id = 0 (NVIDIA TITAN X (Pascal))
Layer-Device Extensions: count = 0
VK_LAYER_VALVE_steam_overlay_32 (Steam Overlay Layer) Vulkan version 1.2.136, layer version 1:
Layer Extensions: count = 0
Devices: count = 1
GPU id = 0 (NVIDIA TITAN X (Pascal))
Layer-Device Extensions: count = 0
VK_LAYER_VALVE_steam_overlay_64 (Steam Overlay Layer) Vulkan version 1.2.136, layer version 1:
Layer Extensions: count = 0
Devices: count = 1
GPU id = 0 (NVIDIA TITAN X (Pascal))
Layer-Device Extensions: count = 0
Presentable Surfaces:
=====================
GPU id : 0 (NVIDIA TITAN X (Pascal)):
Surface types: count = 2
VK_KHR_xcb_surface
VK_KHR_xlib_surface
Formats: count = 2
SurfaceFormat[0]:
format = FORMAT_B8G8R8A8_UNORM
colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
SurfaceFormat[1]:
format = FORMAT_B8G8R8A8_SRGB
colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
Present Modes: count = 3
PRESENT_MODE_FIFO_KHR
PRESENT_MODE_FIFO_RELAXED_KHR
PRESENT_MODE_IMMEDIATE_KHR
VkSurfaceCapabilitiesKHR:
-------------------------
minImageCount = 2
maxImageCount = 8
currentExtent:
width = 256
height = 256
minImageExtent:
width = 256
height = 256
maxImageExtent:
width = 256
height = 256
maxImageArrayLayers = 1
supportedTransforms: count = 1
SURFACE_TRANSFORM_IDENTITY_BIT_KHR
currentTransform = SURFACE_TRANSFORM_IDENTITY_BIT_KHR
supportedCompositeAlpha: count = 1
COMPOSITE_ALPHA_OPAQUE_BIT_KHR
supportedUsageFlags: count = 6
IMAGE_USAGE_TRANSFER_SRC_BIT
I'll try that out!
When trying to run that branch I see
thread 'main' panicked at 'Failed to initialize any backend! Wayland status: NoCompositorListening X11 status: LibraryOpenError(OpenError { kind: Library, detail: "opening library failed (libX11.so.6: cannot open shared object file: No such file or directory); opening library failed (libX11.so: cannot open shared object file: No such file or directory)" })'
yet the output of ldd
is
linux-vdso.so.1 (0x00007ffcbc7f6000)
libexpat.so.1 => /nix/store/hwzah8ba3p9pwwv9zwdy5ysw8m7sljjw-expat-2.4.4/lib/libexpat.so.1 (0x00007f97f4cb8000)
libm.so.6 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libm.so.6 (0x00007f97f4b77000)
libfreetype.so.6 => /nix/store/451fhyz2g9rgk7bd7nxgxjkx015ms0ms-freetype-2.11.1/lib/libfreetype.so.6 (0x00007f97f4ab0000)
libdl.so.2 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libdl.so.2 (0x00007f97f4aab000)
libgcc_s.so.1 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libgcc_s.so.1 (0x00007f97f4a8f000)
librt.so.1 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/librt.so.1 (0x00007f97f4a84000)
libpthread.so.0 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libpthread.so.0 (0x00007f97f4a64000)
libc.so.6 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libc.so.6 (0x00007f97f488e000)
/nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/ld-linux-x86-64.so.2 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib64/ld-linux-x86-64.so.2 (0x00007f97f628e000)
libbz2.so.1 => /nix/store/nsgg55q1kh1ala68pas78hzfxsb3bnjk-bzip2-1.0.6.0.2/lib/libbz2.so.1 (0x00007f97f487b000)
libpng16.so.16 => /nix/store/vdcdfx068hmwqdd6wvsk5a6djlgrqfw4-libpng-apng-1.6.37/lib/libpng16.so.16 (0x00007f97f483f000)
libz.so.1 => /nix/store/bqjh8dc6m5plswxrmmn9x4cpxrrw94lv-zlib-1.2.11/lib/libz.so.1 (0x00007f97f4822000)
Note that I'm using NixOS (/nix/store is like a cache of all the things that the user cannot mutate directly), so sometimes linking stuff is tricky, but I would have at least expected some libx11 or such in that list.
I was checking issues reported upstream and someone had a similar problem while running iced on NixOS, this reply shows a possible solution (for the regular wgpu (vulkan) backend): https://github.com/iced-rs/iced/issues/677#issuecomment-756287334
This one might also be relevant (not sure if it's about the wgpu or glow backends): https://github.com/iced-rs/iced/issues/333
I have never used NixOS, so I have no idea how these configurations work, but if you do and they make sense, please try them out :smile:
Thanks a lot! I will try it.
Okay! The solution outlined in https://github.com/iced-rs/iced/issues/677 works! Thanks so much for this, this will help me out a lot in the future as well. I love being able to search these puzzles by rating like this.
Seems like a iced issue - needs vulkan, which I think I have but still not working. tried to compile with
iced/glow
, butsvg
isn't supported... Any tips?