英文:
What happens if different Vulkan devices contend for same queue family?
问题
例如,我有一张显卡,第一个队列族中有16个队列计数,第二个队列族中有1个队列计数。如果两个不同的逻辑设备(例如来自不同应用程序)尝试从具有仅1个QueueCount的相同队列族获取队列(例如使用vkGetDeviceQueue2
),会发生什么?
英文:
For example, I have a videocard with 16 QueueCount in first queue family and 1 QueueCount in second queue family. What happens if 2 different logical devices (e.g. from different applications) try to acquire (e.g. using vkGetDeviceQueue2
) queues from same queue family that have QueueCount only 1?
答案1
得分: 1
如果一个实现宣传了某种功能,就必须确实提供该功能。如果它宣传了一个家族中的两个队列,就必须提供这两个队列。
如果两个应用程序之间存在争用GPU的情况,实现不能将这种争用暴露给用户。因此,如果GPU中的“家族”只有两个物理命令接口,实现仍然必须像每个应用程序都有两个队列一样运行。这可以通过实现在队列的所有用户之间共享的互斥锁来实现,以便如果有其他人正在提交到该物理队列,vkQueueSubmit
调用会被阻塞。或者可能物理队列可以从任意多个源处理命令,每个进程都有其自己的输入空间。或者其他方法。
这是实现的工作来解决细节问题。
唯一的例外是设备内存限制;不能保证您的程序能够分配Vulkan宣传的所有内存池中的每一个字节。尽管许多实现甚至可以通过虚拟分配来处理这个问题。
英文:
If an implementation advertises something, it is required to actually provide what it advertises. If it advertises two queues in a family, it is required to provide that.
If there is contention for the GPU between two applications, the implementation must not expose this contention to the user. Therefore, if there are only two physical command interfaces for the "family" in the GPU, the implementation must still act like the two applications each have two queues. This can be done by the implementation having a mutex shared among all users of the queue, such that vkQueueSubmit
calls block if someone else is submitting to that physical queue. Or maybe the physical queue can process commands from arbitrarily many sources, with each process getting isolated into its own input space. Or something else.
It is the implementation's job to work out the details.
The only exception to this is device memory limitations; your program is not guaranteed to be able to allocate every byte of the pools of memory Vulkan advertises. Though many implementations can even handle this through virtual allocations.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论