We are using the initRayTracing
code given in the example.
vkGetPhysicalDeviceProperties2
is behaving oddly for us though.
On some machines (GTX4060) it works fine and fills the m_raytracingProperties
structure as expected but on other machines it fails to put any data in teh structure (all 0
).
The two machines I’ve tested on which don’t work are a laptop with a RTX3060 mobile card and an older desk top with a GTX2060 in. Both have I7 Intel processors.
As an experiment I manually set up the contents of m_raytracingProperties
based the on the numbers I see when I run the code on machines it works on, and the rest of the engine code works as expected and the scene renders fine on both the problem machines. Drivers are up to date on both machines.
Has anyone seen anything similar?
Are you initializing the VkPhysicalDeviceProperties2
struct properly before passing it to vkGetPhysicalDeviceProperties2
?
Thanks for getting back to me gkarpa. As far as I can tell I am creating the properties and initializing them exactly as the vulcan initRayTracing example does. This is my code in initRayTracing:
|
VkPhysicalDeviceProperties2 props{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2}; |
|
props.pNext = &m_raytracingProperties; |
|
vkGetPhysicalDeviceProperties2(physicalDevice, &props); |
On return from vkGetPhysical… the props block contains the correct data for the selected GPU (GTX3060 in the case of the laptop) with name etc se up correctly, but m_raytracingProperties contains all zeros. As I said this works exactly as intended on the GTX4060 cards I tested on so I don’t see how it could be something I am not setting up correctly? No errors are reported by the SDK so I don’t know what is going wrong
ok, so what is the m_raytracingProperties
member exactly? A single struct? Another chain? Can you share its own initialization as well?
Hi gKarab. it’s a structure which is part of the initialization chain:typedef struct VkPhysicalDeviceRayTracingPropertiesNV {
VkStructureType sType;
void* pNext;
uint32_t shaderGroupHandleSize;
uint32_t maxRecursionDepth;
uint32_t maxShaderGroupStride;
uint32_t shaderGroupBaseAlignment;
uint64_t maxGeometryCount;
uint64_t maxInstanceCount;
uint64_t maxTriangleCount;
uint32_t maxDescriptorSetAccelerationStructures;
} VkPhysicalDeviceRayTracingPropertiesNV;
I initialize it as per the manaul: m_raytracingProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV;
All otjher members are initialized to 0. I am a bit unclear as to what the difference is between this strucutre and ```
VkPhysicalDeviceRayTracingPipelinePropertiesKHR m_rtProperties{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR};