KhronosGroup / KhronosGroup/Vulkan-Docs

Unclear driver update protocol

Open
#1,319 6 comments 0 reactions 0 assignees View on GitHub
System Integration
Dominant language
JavaScript
Stars
3.3k
Forks
549
Avg merge
5d 5h
Merged PRs (30d)
2

Description

These days driver updates seems to be fine to happen on runtime without restart. But I see many apps misbehaving. Maybe, for the sake of general quality of SW, this case should be well described and handled properly.

Perhaps the spec should be more clear about what is the protocol when a driver is updated. Maybe even add some things to facilitate it.

There seems to be a `VK_ERROR_DEVICE_LOST` for a `VkDevice` and `VkPhysicalDevice`. For the second one the spec seems to imply it is probably unrecoverable. On the other hand, I would expect driver update to cause exactly that `VkPhysicalDevice` to become lost. Or is the same `VkPhysicalDevice` guaranteed after driver update?

It is probably fine if an app panics on thermal problem, GSOD, or the GPU gets hit by a meteor. On the other hand there is no way to disambiguate the normal and good case of a driver update. And the driver update may take a long time, which does look somewhat like some permanent problem of the PC. So I think there is some guidance missing here how to make a well-behaved resilient SW.

Also, driver update might update the `vulkan-1.dll`. I guess that means statically loaded app is stuck with the old version, which should be OK, except any bugs in the Loader and missing support for new extensions and new Vulkan versions. For manually loading app, there should perhaps be guidance when to recreate the `VkInstance` as well (which does not really have `VK_ERROR_INSTANCE_LOST`) and when to reload the dll.

Somewhat relatedly, I think there is missing support for hypothetical hotpluggable GPUs. I think `vkEnumeratePhysicalDevices` is immutable (at least that is the default, and descriptions of the command do not say otherwise). There do not seem to be any event to report a new device connected. And it seems one should not use `vkCreateInstance` frivolously, as it seems to be relatively expensive on some drivers (so probably not wise to poll for the information).

Contributor guide

Open the contributing guide

Research direction

Review the specification sections covering VK_ERROR_DEVICE_LOST, VkDevice, VkPhysicalDevice, vkEnumeratePhysicalDevices, vkCreateInstance, and loader behavior. Determine whether the specification defines driver-update recovery, instance or loader reloading, and hot-pluggable GPU events. Done means the relevant guarantees and recommended application behavior are explicitly documented, or the missing API support is scoped.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.