Skip to content

Unable to access streaming counters with Vulkan? #85

Open
@xoofx

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 (var counter in publicCounterDerivedList)
{
counter.IsSpmCounter = false;
}
}

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

typedef struct VkPhysicalDeviceGpaFeaturesAMD
{
VkStructureType sType;
const void* pNext;
VkBool32 perfCounters;
VkBool32 streamingPerfCounters;
VkBool32 sqThreadTracing;
VkBool32 clockModes;
} VkPhysicalDeviceGpaFeaturesAMD;

typedef struct VkGpaSampleBeginInfoAMD
{
VkStructureType sType;
const void* pNext;
VkGpaSampleTypeAMD sampleType;
VkBool32 sampleInternalOperations;
VkBool32 cacheFlushOnCounterCollection;
VkBool32 sqShaderMaskEnable;
VkGpaSqShaderStageFlagsAMD sqShaderMask;
uint32_t perfCounterCount;
const VkGpaPerfCounterAMD* pPerfCounters;
uint32_t streamingPerfTraceSampleInterval;
VkDeviceSize perfCounterDeviceMemoryLimit;
VkBool32 sqThreadTraceEnable;
VkBool32 sqThreadTraceSuppressInstructionTokens;
VkDeviceSize sqThreadTraceDeviceMemoryLimit;
VkPipelineStageFlagBits timingPreSample;
VkPipelineStageFlagBits timingPostSample;
} 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