protonscr

DXVK Native "Video subsystem has not been initialized" since v2.4

dxvkclosed
doitsujin/dxvk#4842 · opened 2025-04-12 by q4a · updated 2025-04-13 · 3 comments · github
Qq4a 2025-04-12 github

I have simple SDL2+D3D9 test program that uses DXVK Native. With DXVK 2.3.1 it works fine.
With DXVK 2.6.1 I'm getting error:
"Video subsystem has not been initialized"
in this line:
https://github.com/doitsujin/dxvk/blob/v2.6.1/src/wsi/sdl2/wsi_platform_sdl2.cpp#L43

But I'm sure that
SDL_Vulkan_GetInstanceExtensions(nullptr, &extensionCount, nullptr)
works fine, because I added it after SDL_CreateWindow:
https://github.com/q4a/sdl_texture2/blob/dxvk-bug/sdl_d3d9_cube/src/sdl_d3d9_cube.cpp#L310
And getting extensionCount == 2.

My simple SDL2+D3D9 test program is here:
https://github.com/q4a/sdl_texture2/tree/dxvk-bug/sdl_d3d9_cube

Software information

Simple sdl_d3d9_cube.

System information

  • GPU: AMD Radeon HD 8400
  • Driver: Mesa 25.0.3
  • Wine version: not used
  • DXVK version: 2.4-2.6.1 failed (2.3.1 works)

Vulkaininfo

$ vulkaninfo --summary
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /usr/lib/x86_64-linux-gnu/libvulkan_dzn.so. Skipping this driver.
==========
VULKANINFO
==========

Vulkan Instance Version: 1.4.309


Instance Extensions: count = 24
-------------------------------
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_EXT_headless_surface                : extension revision 1
VK_EXT_surface_maintenance1            : extension revision 1
VK_EXT_swapchain_colorspace            : extension revision 5
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_portability_enumeration         : 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
VK_LUNARG_direct_driver_loading        : extension revision 1

Instance Layers: count = 17
---------------------------
VK_LAYER_INTEL_nullhw             INTEL NULL HW                                                                                                     1.1.73   version 1
VK_LAYER_KHRONOS_profiles         Khronos Profiles layer                                                                                            1.4.309  version 1
VK_LAYER_KHRONOS_shader_object    Khronos Shader object layer                                                                                       1.4.309  version 1
VK_LAYER_KHRONOS_synchronization2 Khronos Synchronization2 layer                                                                                    1.4.309  version 1
VK_LAYER_KHRONOS_validation       Khronos Validation Layer                                                                                          1.4.309  version 1
VK_LAYER_LUNARG_api_dump          LunarG API dump layer                                                                                             1.4.309  version 2
VK_LAYER_LUNARG_crash_diagnostic  Crash Diagnostic Layer is a crash/hang debugging tool that helps determines GPU progress in a Vulkan application. 1.4.309  version 1
VK_LAYER_LUNARG_gfxreconstruct    GFXReconstruct Capture Layer Version 1.0.5-unknown                                                                1.4.309  version 4194309
VK_LAYER_LUNARG_monitor           Execution Monitoring Layer                                                                                        1.4.309  version 1
VK_LAYER_LUNARG_screenshot        LunarG image capture layer                                                                                        1.4.309  version 1
VK_LAYER_MANGOHUD_overlay         Vulkan Hud Overlay                                                                                                1.3.0    version 1
VK_LAYER_MESA_device_select       Linux device selection layer                                                                                      1.4.303  version 1
VK_LAYER_MESA_overlay             Mesa Overlay layer                                                                                                1.4.303  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         = 1.3.305
        driverVersion      = 25.0.3
        vendorID           = 0x1002
        deviceID           = 0x9830
        deviceType         = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
        deviceName         = AMD Radeon HD 8400 / R3 Series (RADV KABINI)
        driverID           = DRIVER_ID_MESA_RADV
        driverName         = radv
        driverInfo         = Mesa 25.0.3 - kisak-mesa PPA
        conformanceVersion = 1.4.0.0
        deviceUUID         = 00000000-0000-0000-0100-000000000000
        driverUUID         = 414d442d-4d45-5341-2d44-525600000000
GPU1:
        apiVersion         = 1.4.305
        driverVersion      = 0.0.1
        vendorID           = 0x10005
        deviceID           = 0x0000
        deviceType         = PHYSICAL_DEVICE_TYPE_CPU
        deviceName         = llvmpipe (LLVM 19.1.7, 256 bits)
        driverID           = DRIVER_ID_MESA_LLVMPIPE
        driverName         = llvmpipe
        driverInfo         = Mesa 25.0.3 - kisak-mesa PPA (LLVM 19.1.7)
        conformanceVersion = 1.3.1.1
        deviceUUID         = 6d657361-3235-2e30-2e33-202d206b6900
        driverUUID         = 6c6c766d-7069-7065-5555-494400000000
Ddoitsujin maintainer 2025-04-12 github

How do you build your test project?

dxvk-native stuff has changed quite a bit in 2.4 in order to introduce a more stable abi and api, so it is expected that unmodified code from previous versions no longer works. Don't remember off the top of my head what changed, but wsi backend having to be set via an env var in order to be initialized properly is one of them.

Qq4a 2025-04-12 github

Build steps is simple:

cd sdl_d3d9_cube
cmake --preset='ninja-Debug'
cmake --build --preset='Debug'

My system is Ubuntu 24.10, compiler is gcc.
I saw about WSI changes and using env var: DXVK_WSI_DRIVER=SDL2

Qq4a 2025-04-13 github

Sorry to bother you. I found the problem - sdl_d3d9_cube was statically linked with SDL 2.32.4 and dxvk was using system libSDL2-2.0.so.0

Launch options