Swiftshader or Mesa's lavapipe? #1181
Replies: 3 comments
-
Vulkan lists all the "physical devices" that available and you can select which one to use. On my Kubuntu 22.04 system if I had the hardware accelerated driver listed first, then the lavapipe one so it's actually one device with two drivers. The vsgdeviceselection example lists the available options and illustrates how to select the one you want to use, so you can explicitly tell it to use the software driver. I've found the performance surprising good with the software driver. Have a look at the vsgdeviceselection example and experiment. I'm currently using a Windows 11 with NVidia drivers so can't list the linux output, but this is what I see when I run: vsgdeviceselection.exe --list
vkEnumerateInstanceVersion() 4206867
VK_API_VERSION = 1.3.275.0
physicalDevices.size() = 1
matched ref_ptr<vsg::PhysicalDevice>(vsg::PhysicalDevice 000002684AF47C88) NVIDIA GeForce RTX 2060, deviceType = 2, apiVersion = 1.3.277, driverVersion = 40.48.0
QueueFamilyProperties 5
VkQueueFamilyProperties[0] queueFlags = GRAPHICS | COMPUTE | TRANSFER | PARSE_BINDING, queueCount = 16, timestampValidBits = 64, minImageTransferGranularity = {1, 1, 1}
VkQueueFamilyProperties[1] queueFlags = TRANSFER | PARSE_BINDING, queueCount = 2, timestampValidBits = 64, minImageTransferGranularity = {1, 1, 1}
VkQueueFamilyProperties[2] queueFlags = COMPUTE | TRANSFER | PARSE_BINDING, queueCount = 8, timestampValidBits = 64, minImageTransferGranularity = {1, 1, 1}
VkQueueFamilyProperties[3] queueFlags = TRANSFER | PARSE_BINDING | VIDEO_DECODE, queueCount = 1, timestampValidBits = 32, minImageTransferGranularity = {1, 1, 1}
VkQueueFamilyProperties[4] queueFlags = TRANSFER | PARSE_BINDING | VIDEO_ENCODE, queueCount = 1, timestampValidBits = 32, minImageTransferGranularity = {1, 1, 1} |
Beta Was this translation helpful? Give feedback.
-
I should add when you list the vk/vsg::PhysicalDevice available the deviceType will tell you whether it's hardware driver or software: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceType.html // Provided by VK_VERSION_1_0
typedef enum VkPhysicalDeviceType {
VK_PHYSICAL_DEVICE_TYPE_OTHER = 0,
VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1,
VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2,
VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3,
VK_PHYSICAL_DEVICE_TYPE_CPU = 4,
} VkPhysicalDeviceType; |
Beta Was this translation helpful? Give feedback.
-
On my Ubuntu 22.04 Intel laptop this is what I see: $ vsgdeviceselection --list
vkEnumerateInstanceVersion() 4206867
VK_API_VERSION = 1.3.275.0
physicalDevices.size() = 2
matched ref_ptr<vsg::PhysicalDevice>(vsg::PhysicalDevice 0x7c9001e78d28) Intel(R) Xe Graphics (TGL GT2), deviceType = 1, apiVersion = 1.3.255, driverVersion = 23.2.1
QueueFamilyProperties 1
VkQueueFamilyProperties[0] queueFlags = GRAPHICS | COMPUTE | TRANSFER, queueCount = 1, timestampValidBits = 36, minImageTransferGranularity = {1, 1, 1}
matched ref_ptr<vsg::PhysicalDevice>(vsg::PhysicalDevice 0x7c9001e79198) llvmpipe (LLVM 15.0.7, 256 bits), deviceType = 4, apiVersion = 1.3.255, driverVersion = 0.0.1
QueueFamilyProperties 1
VkQueueFamilyProperties[0] queueFlags = GRAPHICS | COMPUTE | TRANSFER, queueCount = 1, timestampValidBits = 64, minImageTransferGranularity = {1, 1, 1} When selecting PhysicalDevice 0 this is what I see on the console: $ vsgdeviceselection --select 0
vkEnumerateInstanceVersion() 4206867
VK_API_VERSION = 1.3.275.0
Selected vsg::PhysicalDevice ref_ptr<vsg::PhysicalDevice>(vsg::PhysicalDevice 0x7faeee8ffd28) Intel(R) Xe Graphics (TGL GT2) deviceType = 1 PhysicalDevice 1: $ vsgdeviceselection --select 1
vkEnumerateInstanceVersion() 4206867
VK_API_VERSION = 1.3.275.0
Selected vsg::PhysicalDevice ref_ptr<vsg::PhysicalDevice>(vsg::PhysicalDevice 0x781e1bc58198) llvmpipe (LLVM 15.0.7, 256 bits) deviceType = 4 Note the deviceType of VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU and VK_PHYSICAL_DEVICE_TYPE_CPU respectively. This is an area where Vulkan is so much conrollable than OpenGL. |
Beta Was this translation helpful? Give feedback.
-
Hi! I was wonder - has anyone tried using VulkanSceneGraph with the software-only backends (Google's swiftshader and Mesa lavapipe)?
I know CPU-only is not going to be a preferred or high performing mode for Vulkan, but given OpenGL has software-only fallbacks that can be used if the GPU is unavailable for any reason I was curious if one of the software-only Vulkan implementations is know to be usable for achieving a similar robustness with VulkanSceneGraph...
Beta Was this translation helpful? Give feedback.
All reactions