hanatos / vkdt

raw photography workflow that sucks less

Home Page:https://vkdt.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cut-off thumbnail render

leuc opened this issue · comments

commented

Both in light table and in editing any picture, jpg or raw is cut-off at the end. Zooming makes no difference. Only when actually changing the developing parameters is the full image rendered. Going back to the light table renders a broken image again. I guess it's only the thumbnail render?

image

Running on a AMD Laptop with dedicated AMD GPU.

It seems to make no difference what GPU i select with DRI_PRIME (except for performance.)

DRI_PRIME=1 vkdt --version
vkdt 0.5.0+git14.d8d8a1a-0+102.1 (c) 2020--2023 johannes hanika
lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.1 LTS
Release:	22.04
Codename:	jammy
DRI_PRIME=1 vulkaninfo --summary
[...]
VULKANINFO
==========

Vulkan Instance Version: 1.3.204


Instance Extensions: count = 19
-------------------------------
VK_EXT_acquire_drm_display             : extension revision 1
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

Instance Layers: count = 6
--------------------------
VK_LAYER_MESA_device_select       Linux device selection layer 1.3.211  version 1
VK_LAYER_MESA_overlay             Mesa Overlay layer           1.3.211  version 1
VK_LAYER_VALVE_steam_fossilize_32 Steam Pipeline Caching Layer 1.3.207  version 1
VK_LAYER_VALVE_steam_fossilize_64 Steam Pipeline Caching Layer 1.3.207  version 1
VK_LAYER_VALVE_steam_overlay_32   Steam Overlay Layer          1.3.207  version 1
VK_LAYER_VALVE_steam_overlay_64   Steam Overlay Layer          1.3.207  version 1

Devices:
========
GPU0:
	apiVersion         = 4206796 (1.3.204)
	driverVersion      = 92274693 (0x5800005)
	vendorID           = 0x1002
	deviceID           = 0x731f
	deviceType         = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
	deviceName         = AMD RADV NAVI10
	driverID           = DRIVER_ID_MESA_RADV
	driverName         = radv
	driverInfo         = Mesa 22.0.5
	conformanceVersion = 1.2.7.1
	deviceUUID         = xxx
	driverUUID         = xxx
GPU1:
	apiVersion         = 4202700 (1.2.204)
	driverVersion      = 1 (0x0001)
	vendorID           = 0x10005
	deviceID           = 0x0000
	deviceType         = PHYSICAL_DEVICE_TYPE_CPU
	deviceName         = llvmpipe (LLVM 13.0.1, 256 bits)
	driverID           = DRIVER_ID_MESA_LLVMPIPE
	driverName         = llvmpipe
	driverInfo         = Mesa 22.0.5 (LLVM 13.0.1)
	conformanceVersion = 0.0.0.0
	deviceUUID         = xxx
	driverUUID         = xxx
GPU2:
	apiVersion         = 4206796 (1.3.204)
	driverVersion      = 92274693 (0x5800005)
	vendorID           = 0x1002
	deviceID           = 0x1636
	deviceType         = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
	deviceName         = AMD RADV RENOIR
	driverID           = DRIVER_ID_MESA_RADV
	driverName         = radv
	driverInfo         = Mesa 22.0.5
	conformanceVersion = 1.2.7.1
	deviceUUID         = xx
	driverUUID         = xx

heya, thanks for the detailed report.

not sure DRI_PRIME does anything, vulkan is pretty free at selecting the gpu. see vkdt -d qvk for an output which one it's actually selecting (you can force it in ~/.config/vkdt/config.rc).

these render artifacts look really strange. the thumbnails are written in bc1/block based, maybe that's what we're seeing here? but you mentioned it happens when editing for real too. so maybe it's more an amd specific way of storing images? i'm guessing randomly here. did you build from source? maybe your driver has instructive validation layer output if you

make clean
make debug -j20
vkdt -d qvk

(i.e. compile with validation layer/debug support and run with vk output enabled)

commented

OK, it gets a little more reproducible. Before each run i rm -rv ~/.cache/vkdt

setting the card to 0 via config.rc i get sluggish, almost unresponsive performance and vkdt is at 90% cpu load.

However, the thumbnails are rendered correctly, just very slowly.

[gui] glfwGetVersionString() : 3.3.6 X11 GLX EGL OSMesa clock_gettime evdev shared
[gui] monitor [0] eDP at 0 0
[gui] vk extension required by GLFW:
[gui]   VK_KHR_surface
[gui]   VK_KHR_xcb_surface
[qvk] dev 0: vendorid 0x1002
[qvk] dev 0: AMD RADV RENOIR
[qvk] max number of allocations -1
[qvk] max image allocation size 16384 x 16384
[qvk] max uniform buffer range 4294967295
[qvk] selecting device 0 by explicit request
[qvk] dev 1: vendorid 0x10005
[qvk] dev 1: llvmpipe (LLVM 13.0.1, 256 bits)
[qvk] max number of allocations -1
[qvk] max image allocation size 16384 x 16384
[qvk] max uniform buffer range 65536
[qvk] device 1 does not support requested feature shaderSampledImageArrayDynamicIndexing, trying anyways
[qvk] device 1 does not support requested feature shaderStorageImageArrayDynamicIndexing, trying anyways
[qvk] device 1 does not support requested feature inheritedQueries, trying anyways
[qvk] dev 2: vendorid 0x1002
[qvk] dev 2: AMD RADV NAVI10
[qvk] max number of allocations -1
[qvk] max image allocation size 16384 x 16384
[qvk] max uniform buffer range 4294967295
[qvk] num queue families: 2
[qvk] picked device 0 without ray tracing and without float atomics support
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[gui] no joysticks found
[gui] no display profile file display.eDP, using sRGB!
[gui] no display profile file display.eDP, using sRGB!
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0

Setting the device to 2 i get great performance, but the thumbnails get cut-off and some images even have more glitches. I also notice "green" overall UI render glitches when moving around the light table.

When adjusting any sliders in develop mode the image does fully render without glitches.

[gui] glfwGetVersionString() : 3.3.6 X11 GLX EGL OSMesa clock_gettime evdev shared
[gui] monitor [0] eDP at 0 0
[gui] vk extension required by GLFW:
[gui]   VK_KHR_surface
[gui]   VK_KHR_xcb_surface
[qvk] dev 0: vendorid 0x1002
[qvk] dev 0: AMD RADV RENOIR
[qvk] max number of allocations -1
[qvk] max image allocation size 16384 x 16384
[qvk] max uniform buffer range 4294967295
[qvk] dev 1: vendorid 0x10005
[qvk] dev 1: llvmpipe (LLVM 13.0.1, 256 bits)
[qvk] max number of allocations -1
[qvk] max image allocation size 16384 x 16384
[qvk] max uniform buffer range 65536
[qvk] device 1 does not support requested feature shaderSampledImageArrayDynamicIndexing, trying anyways
[qvk] device 1 does not support requested feature shaderStorageImageArrayDynamicIndexing, trying anyways
[qvk] device 1 does not support requested feature inheritedQueries, trying anyways
[qvk] dev 2: vendorid 0x1002
[qvk] dev 2: AMD RADV NAVI10
[qvk] max number of allocations -1
[qvk] max image allocation size 16384 x 16384
[qvk] max uniform buffer range 4294967295
[qvk] selecting device 2 by explicit request
[qvk] num queue families: 2
[qvk] picked device 2 without ray tracing and without float atomics support
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[gui] no joysticks found
[gui] no display profile file display.eDP, using sRGB!
[gui] no display profile file display.eDP, using sRGB!
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
Invalid SOS parameters for sequential JPEG
Invalid SOS parameters for sequential JPEG
RawSpeed:Compressor Version: CanonCR3_001/00.09.00/00.00.00
[ERR] kernel hilite_01_half:input is not connected!
[ERR] kernel hilite_01_doub:input is not connected!
[ERR] input hilite:input not connected!
[qvk] error VK_INCOMPLETE executing record_command_buffer(graph, graph->node+nodeid[i], run_all || (graph->node[nodeid[i]].module->flags & s_module_request_read_source))!
[ERR] kernel hilite_01_half:input is not connected!
[ERR] kernel hilite_01_doub:input is not connected!
[ERR] input hilite:input not connected!
[qvk] error VK_INCOMPLETE executing record_command_buffer(graph, graph->node+nodeid[i], run_all || (graph->node[nodeid[i]].module->flags & s_module_request_read_source))!
[ERR] kernel hilite_01_half:input is not connected!
[ERR] kernel hilite_01_doub:input is not connected!
[ERR] input hilite:input not connected!
[qvk] error VK_INCOMPLETE executing record_command_buffer(graph, graph->node+nodeid[i], run_all || (graph->node[nodeid[i]].module->flags & s_module_request_read_source))!
[ERR] kernel hilite_01_half:input is not connected!
[ERR] kernel hilite_01_doub:input is not connected!
[ERR] input hilite:input not connected!
[qvk] error VK_INCOMPLETE executing record_command_buffer(graph, graph->node+nodeid[i], run_all || (graph->node[nodeid[i]].module->flags & s_module_request_read_source))!
[ERR] kernel hilite_01_half:input is not connected!
[ERR] kernel hilite_01_doub:input is not connected!
[ERR] input hilite:input not connected!
[qvk] error VK_INCOMPLETE executing record_command_buffer(graph, graph->node+nodeid[i], run_all || (graph->node[nodeid[i]].module->flags & s_module_request_read_source))!
[ERR] kernel hilite_01_half:input is not connected!
[ERR] kernel hilite_01_doub:input is not connected!
[ERR] input hilite:input not connected!
[qvk] error VK_INCOMPLETE executing record_command_buffer(graph, graph->node+nodeid[i], run_all || (graph->node[nodeid[i]].module->flags & s_module_request_read_source))!
[ERR] kernel hilite_01_half:input is not connected!
[ERR] kernel hilite_01_doub:input is not connected!
[ERR] input hilite:input not connected!
[qvk] error VK_INCOMPLETE executing record_command_buffer(graph, graph->node+nodeid[i], run_all || (graph->node[nodeid[i]].module->flags & s_module_request_read_source))!
[qvk] error VK_SUBOPTIMAL_KHR executing vkAcquireNextImageKHR(qvk.device, qvk.swap_chain, 2ul<<30, image_acquired_semaphore, VK_NULL_HANDLE, &vkdt.frame_index)!
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] error VK_SUBOPTIMAL_KHR executing vkAcquireNextImageKHR(qvk.device, qvk.swap_chain, 2ul<<30, image_acquired_semaphore, VK_NULL_HANDLE, &vkdt.frame_index)!
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] error VK_SUBOPTIMAL_KHR executing vkAcquireNextImageKHR(qvk.device, qvk.swap_chain, 2ul<<30, image_acquired_semaphore, VK_NULL_HANDLE, &vkdt.frame_index)!
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] error VK_SUBOPTIMAL_KHR executing vkAcquireNextImageKHR(qvk.device, qvk.swap_chain, 2ul<<30, image_acquired_semaphore, VK_NULL_HANDLE, &vkdt.frame_index)!
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] error VK_SUBOPTIMAL_KHR executing vkAcquireNextImageKHR(qvk.device, qvk.swap_chain, 2ul<<30, image_acquired_semaphore, VK_NULL_HANDLE, &vkdt.frame_index)!
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0

(VK_INCOMPLETE seems to be triggered by some of my test images, probably a different issue. Only happens with the initial thumbnail generation)

Using the OBS ppa at the moment, but I'll try the debug build.

commented

OK, another odd but reproducible behavior that might narrow it down.

Initial state after opening a DNG in develop mode with cut-off image (and some histogram glitches)

image

I move the strength slider a little and the image renders correctly.

If i move the strength slider back to zero, the cut-off image glitch re-appears(!).

image

Touching any other sliders in favorites simply renders the full image, even when reset to default value.

Screenshot after changing some parameters but setting strength back to zero.

image

hm with amd i'm always poking around in the dark because i don't have access to such a device to test. it seems this one would support floating point atomics (which is good) and i'm incorrectly classifying it as unsupported (pushed something, you can pull and test whether that changes anything at all if you want).

the half-rendered image looks more like a queue synchronisation issue though.

maybe the VK_SUBOPTIMAL_KHR is hinting at something? if you resize the window (i.e. recreate the swapchain) does it help?

commented

Resizing the main window doesn't remove the cut-off

the make debug build fails to load vulkan

file bin/vkdt
bin/vkdt: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=57bf5662d752759f128deffaf7cb3101a107e738, for GNU/Linux 3.2.0, with debug_info, not stripped

./bin/vkdt -d qvk
[gui] glfwGetVersionString() : 3.3.6 X11 GLX EGL OSMesa clock_gettime evdev shared
[gui] monitor [0] eDP at 0 0
[gui] vk extension required by GLFW:
[gui]   VK_KHR_surface
[gui]   VK_KHR_xcb_surface
[qvk] error VK_ERROR_LAYER_NOT_PRESENT executing vkCreateInstance(&inst_create_info, NULL, &qvk.instance)!
[ERR] init vulkan failed
[ERR] failed to init gui/swapchain

the normal release build shows the same cut-off behavior at 12fa3f9

file bin/vkdt
bin/vkdt: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=49ff41b0fad85d51bf9e70319ed4625f9e020e60, for GNU/Linux 3.2.0, stripped

./bin/vkdt -d qvk
[gui] glfwGetVersionString() : 3.3.6 X11 GLX EGL OSMesa clock_gettime evdev shared
[gui] monitor [0] eDP at 0 0
[gui] vk extension required by GLFW:
[gui]   VK_KHR_surface
[gui]   VK_KHR_xcb_surface
[qvk] dev 0: vendorid 0x1002
[qvk] dev 0: AMD RADV RENOIR
[qvk] max number of allocations -1
[qvk] max image allocation size 16384 x 16384
[qvk] max uniform buffer range 4294967295
[qvk] dev 1: vendorid 0x10005
[qvk] dev 1: llvmpipe (LLVM 13.0.1, 256 bits)
[qvk] max number of allocations -1
[qvk] max image allocation size 16384 x 16384
[qvk] max uniform buffer range 65536
[qvk] device 1 does not support requested feature shaderSampledImageArrayDynamicIndexing, trying anyways
[qvk] device 1 does not support requested feature shaderStorageImageArrayDynamicIndexing, trying anyways
[qvk] device 1 does not support requested feature inheritedQueries, trying anyways
[qvk] dev 2: vendorid 0x1002
[qvk] dev 2: AMD RADV NAVI10
[qvk] max number of allocations -1
[qvk] max image allocation size 16384 x 16384
[qvk] max uniform buffer range 4294967295
[qvk] selecting device 2 by explicit request
[qvk] num queue families: 2
[qvk] picked device 2 without ray tracing and without float atomics support
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[gui] no joysticks found
[gui] no display profile file display.eDP, using sRGB!
[gui] no display profile file display.eDP, using sRGB!
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
[qvk] available surface formats:
[qvk] B8G8R8A8_SRGB
[qvk] B8G8R8A8_UNORM
[qvk] colour space: 0
./bin/vkdt --version
vkdt 0.5.0-23-g12fa3f98 (c) 2020--2023 johannes hanika

from the vulkaninfo for the device 2

VkPhysicalDeviceShaderAtomicFloatFeaturesEXT

shaderBufferFloat32Atomics = true
shaderBufferFloat32AtomicAdd = false
shaderBufferFloat64Atomics = true
shaderBufferFloat64AtomicAdd = false
shaderSharedFloat32Atomics = true
shaderSharedFloat32AtomicAdd = true
shaderSharedFloat64Atomics = true
shaderSharedFloat64AtomicAdd = false
shaderImageFloat32Atomics = true
shaderImageFloat32AtomicAdd = false
sparseImageFloat32Atomics = true
sparseImageFloat32AtomicAdd = false

VK_ERROR_LAYER_NOT_PRESENT means you have to install the vulkan-validationlayers package (whatever it is called in your distro).

ah, shaderImageFloat32AtomicAdd is actually what i need, so it doesn't have atomics after all.

one of your images looked like the local contrast was applied to an incomplete/blocky image. also the histogram render has the blocks (and that's certainly not coming from an earlier module). that looks like a generic problem with barriers/image format conversion to me. might it be a driver issue?

commented

I installed vulkan with the amdgpu-pro stack and the cut-off artifacts do disappear.

amdgpu-install --vulkan=pro --no-dkms --accept-eula --no-32 --usecase=graphics

vulkaninfo reports the same set of VkPhysicalDeviceShaderAtomicFloatFeaturesEXT features.

Devices:
========
GPU0:
	apiVersion         = 4206824 (1.3.232)
	driverVersion      = 8388855 (0x8000f7)
	vendorID           = 0x1002
	deviceID           = 0x1636
	deviceType         = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
	deviceName         = Unknown AMD GPU
	driverID           = DRIVER_ID_AMD_PROPRIETARY
	driverName         = AMD proprietary driver
	driverInfo         = (AMD proprietary shader compiler)
	conformanceVersion = 1.3.0.0
[..]
GPU1:
	apiVersion         = 4206824 (1.3.232)
	driverVersion      = 8388855 (0x8000f7)
	vendorID           = 0x1002
	deviceID           = 0x731f
	deviceType         = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
	deviceName         = AMD Radeon RX 5600M
	driverID           = DRIVER_ID_AMD_PROPRIETARY
	driverName         = AMD proprietary driver
	driverInfo         = (AMD proprietary shader compiler)
	conformanceVersion = 1.3.0.0
[...]

I'll try some more driver combinations and maybe a mesa update.

Closing since nothing to fix on vkdt end.