Skip to content

Slow startup when using gpu-api = vulkan with NVIDIA #13019

@GrzegorzKozub

Description

@GrzegorzKozub

Important Information

Reproduction steps

Run on Windows with NVIDIA and setup mpv to use Vulkan as GPU API. This is my config file:

vo = gpu-next
hwdec = nvdec or vulkan
gpu-api = vulkan

Expected behavior

The player starts without a delay.

Actual behavior

The player takes about 2 seconds to start and there are reports of delays when creating Vulkan instance and device:

[vo/gpu-next/libplacebo] Spent 1037.710 ms creating vulkan instance (slow!)
[vo/gpu-next/libplacebo] Spent 350.304 ms creating vulkan device (slow!)

When does it NOT happen

Tested on multiple machines and OS. This does NOT happen in the following situations:

  • When running on Linux with AMD using Wayland with the config above
  • When running on Windows with AMD with the config above
  • When running on Linux with NVIDIA using X11 with the config above
  • When running on Windows with NVIDIA (same setup as with the issue) but NOT using Vulkan, for example:
vo = gpu-next
hwdec = nvdec
gpu-api = opengl
gpu-context = win

Log file

The relevant part of the log file (also attached as output.txt):

[vo/gpu-next/vulkan] Initializing GPU context 'winvk'
[vo/gpu-next/libplacebo] Initialized libplacebo v6.338.0-60-g795600a-dirty (API v342)
[vo/gpu-next/libplacebo] Spent 93.897 ms enumerating instance extensions
[vo/gpu-next/libplacebo] Creating vulkan instance with extensions:
[vo/gpu-next/libplacebo]     VK_KHR_get_physical_device_properties2
[vo/gpu-next/libplacebo]     VK_KHR_surface
[vo/gpu-next/libplacebo]     VK_EXT_swapchain_colorspace
[vo/gpu-next/libplacebo]     VK_KHR_external_memory_capabilities
[vo/gpu-next/libplacebo]     VK_KHR_external_semaphore_capabilities
[vo/gpu-next/libplacebo]     VK_KHR_get_surface_capabilities2
[vo/gpu-next/libplacebo]     VK_KHR_portability_enumeration
[vo/gpu-next/libplacebo]     VK_KHR_surface
[vo/gpu-next/libplacebo]     VK_KHR_win32_surface
[vo/gpu-next/libplacebo] Spent 1037.710 ms creating vulkan instance (slow!)
[vo/gpu-next/libplacebo] Probing for vulkan devices:
[vo/gpu-next/libplacebo]     GPU 0: NVIDIA GeForce RTX 3080 v1.3.260 (discrete)
[vo/gpu-next/libplacebo]            uuid: F7:9C:C7:F0:2E:57:EB:B3:87:B4:E8:95:88:06:06:BF
[vo/gpu-next/libplacebo] Vulkan device properties:
[vo/gpu-next/libplacebo]     Device Name: NVIDIA GeForce RTX 3080
[vo/gpu-next/libplacebo]     Device ID: 10de:2206
[vo/gpu-next/libplacebo]     Device UUID: F7:9C:C7:F0:2E:57:EB:B3:87:B4:E8:95:88:06:06:BF
[vo/gpu-next/libplacebo]     Driver version: 88844000
[vo/gpu-next/libplacebo]     API version: 1.3.260
[vo/gpu-next/libplacebo] Using async transfer (queue 1)
[vo/gpu-next/libplacebo] Using async compute (queue 2)
[vo/gpu-next/libplacebo] Creating vulkan device with extensions:
[vo/gpu-next/libplacebo]     VK_KHR_swapchain
[vo/gpu-next/libplacebo]     VK_KHR_swapchain
[vo/gpu-next/libplacebo]     VK_KHR_push_descriptor
[vo/gpu-next/libplacebo]     VK_KHR_external_memory_win32
[vo/gpu-next/libplacebo]     VK_EXT_external_memory_host
[vo/gpu-next/libplacebo]     VK_KHR_external_semaphore_win32
[vo/gpu-next/libplacebo]     VK_EXT_pci_bus_info
[vo/gpu-next/libplacebo]     VK_EXT_hdr_metadata
[vo/gpu-next/libplacebo]     VK_EXT_full_screen_exclusive
[vo/gpu-next/libplacebo]     VK_EXT_descriptor_buffer
[vo/gpu-next/libplacebo]     VK_EXT_shader_atomic_float
[vo/gpu-next/libplacebo]     VK_KHR_video_decode_queue
[vo/gpu-next/libplacebo]     VK_KHR_video_decode_h264
[vo/gpu-next/libplacebo]     VK_KHR_video_decode_h265
[vo/gpu-next/libplacebo]     VK_KHR_video_queue
[vo/gpu-next/libplacebo] Spent 350.304 ms creating vulkan device (slow!)

Sample files

This issue is irrelevant of the media file used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions