Skip to content

Unable to access streaming counters with Vulkan? #85

Description

@xoofx

Hello there,

Calling GpaGetSupportedSampleTypes on my GPU (RX 7600 XT) with Vulkan only returns kGpaContextSampleTypeDiscreteCounter but not kGpaContextSampleTypeStreamingCounter, so I'm not able to access streaming counters like WaveOccupancyPct.

Is there anything special to deploy or to tweak in order to access such counters?

Edit: Looking at the code, it is indeed hardcoded to only support discrete:

supported_sample_types_ = kGpaContextSampleTypeDiscreteCounter;

Seems removed here:

if("dx12"!=api.ToLower())
{
// Non-DX12 only supports discrete counters. Enforce this.
// Remove SPM-only counters if they happen to exist.
publicCounterDerivedList.RemoveAll(x =>(x.IsSpmCounter&&!x.IsDiscreteCounter));
// Force the counters to not indicate they are SPM counters. This simplifies a lot of logic later.
foreach(varcounterinpublicCounterDerivedList)
{
counter.IsSpmCounter=false;
}
}

While the VK extensions seem to have a few stuffs related to spm:

typedefstructVkPhysicalDeviceGpaFeaturesAMD
{
VkStructureTypesType;
constvoid*pNext;
VkBool32perfCounters;
VkBool32streamingPerfCounters;
VkBool32sqThreadTracing;
VkBool32clockModes;
} VkPhysicalDeviceGpaFeaturesAMD;

typedefstructVkGpaSampleBeginInfoAMD
{
VkStructureTypesType;
constvoid*pNext;
VkGpaSampleTypeAMDsampleType;
VkBool32sampleInternalOperations;
VkBool32cacheFlushOnCounterCollection;
VkBool32sqShaderMaskEnable;
VkGpaSqShaderStageFlagsAMDsqShaderMask;
uint32_tperfCounterCount;
constVkGpaPerfCounterAMD*pPerfCounters;
uint32_tstreamingPerfTraceSampleInterval;
VkDeviceSizeperfCounterDeviceMemoryLimit;
VkBool32sqThreadTraceEnable;
VkBool32sqThreadTraceSuppressInstructionTokens;
VkDeviceSizesqThreadTraceDeviceMemoryLimit;
VkPipelineStageFlagBitstimingPreSample;
VkPipelineStageFlagBitstimingPostSample;
} VkGpaSampleBeginInfoAMD;

So, what needs to be done to support streaming? Is it possible with the internal codebase by replicating what is done for d3d12 to Vulkan or it requires internal changes to some AMD drivers?

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