Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hey #9

Closed
kingofthebongo2008 opened this issue Oct 21, 2020 · 6 comments
Closed

Hey #9

kingofthebongo2008 opened this issue Oct 21, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@kingofthebongo2008
Copy link
Contributor

With the memory allocator there are some issues from the gpu based validator.

there is an uav which runs fine on the gpu, however i get warnings in the validator.

They do not happen on the cpu validator.
If i use only committed memory, there are no such errors.
I am looking where this may come from

D3D12 ERROR: GPU-BASED VALIDATION: Dispatch, Incompatible resource state: Resource: 0x000002BA10D56500:'Unnamed ID3D12Resource Object', Subresource Index: [0], Root descriptor type: UAV, Resource State: D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE(0x40) (Promoted from COMMON state), Shader Stage: COMPUTE, Root Parameter Index: [2], Dispatch Index: [21], Shader Code: <couldn't find file location in debug info>, Asm Instruction Range: [0xa-0xffffffff], Asm Operand Index: [0], Command List: 0x000002BA10951520:'CommandList 2, Allocator 0', SRV/UAV/CBV Descriptor Heap: 0x000002BA10693200:'StaticHeapDX12', Sampler Descriptor Heap: 0x000002BA10696300:'StaticHeapDX12', Pipeline State: 0x000002BA4D5C6A00:'TressFXSDFCollision.hlslCollideHairVerticesWithSdf_forward', [ EXECUTION ERROR #942: GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE]

@adam-sawicki-a adam-sawicki-a added the bug Something isn't working label Oct 21, 2020
@adam-sawicki-a
Copy link
Collaborator

I don't know where can this issue come from, as resource states are tracked per resource, not per memory heap where they are placed. The message says the resource state has been automatically promoted from COMMON to NON_PIXEL_SHADER_RESOURCE and then used as UAV. Please try to explicitly transition it to UNORDERED_ACCESS state before using it for the compute dispatch and see if it helps.

It is also possible that the validation layer has bugs. You can capture a frame using PIX and see what barriers, draw calls, and dispatches are executed that use this texture to figure out whether there is really something wrong with its state or it is a false alarm.

@adam-sawicki-a adam-sawicki-a added the input needed Waiting for more information label Oct 21, 2020
@kingofthebongo2008
Copy link
Contributor Author

there was one shader that was reading from uav, i have made it srv and the warning went away,
however now i have the same issue with the another uav,

It is in CollideHairVerticesWithSdf_forward from the tressfx sample. HairVertices buffer which is expected to be RW

Also something else.

If make allocations with ALLOCATION_FLAG_COMMITTED i still get the warning however if

I force CalcDefaultPoolIndex to return UINT32_MAX they stop.

I am on AMD 5700 XT

On the cpu side everything is correct no warnings from validation, may be there is a memory aliasing

any clue will be helpful.

I have not seen such a warning before from DX12.

D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: BoneSkinningUpdate [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: BoneSkinningUpdate [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: UpdateSDF [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: UpdateSDF::ConstructSignedDistanceField [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: UpdateSDF::ConstructSignedDistanceField [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: UpdateSDF::ConstructSignedDistanceField [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: UpdateSDF::ConstructSignedDistanceField [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: UpdateSDF::ConstructSignedDistanceField [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: UpdateSDF::ConstructSignedDistanceField [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: UpdateSDF [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: RunSimulation [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: RunSimulation::IntegrationAndGlobalShapeContraints [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: RunSimulation::IntegrationAndGlobalShapeContraints [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: RunSimulation::CalculateStrandLevelData [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: RunSimulation::CalculateStrandLevelData [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: RunSimulation::VelocityShockPropagation [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: RunSimulation::VelocityShockPropagation [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: RunSimulation::LocalShapeConstraints [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: RunSimulation::LocalShapeConstraints [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: RunSimulation::LengthConstriantsWindAndCollision [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: RunSimulation::LengthConstriantsWindAndCollision [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: RunSimulation::UpdateFollowHairVertices [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: RunSimulation::UpdateFollowHairVertices [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: RunSimulation [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: RunCollision [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: RunCollision::CollideWithHair [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 ERROR: GPU-BASED VALIDATION: Dispatch, Incompatible resource state: Resource: 0x000002455B6852B0:'Unnamed ID3D12Resource Object', Subresource Index: [0], Root descriptor type: UAV, Resource State: D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE(0x40) (Promoted from COMMON state), Shader Stage: COMPUTE, Root Parameter Index: [2], Dispatch Index: [21], Shader Code: <couldn't find file location in debug info>, Asm Instruction Range: [0xa-0xffffffff], Asm Operand Index: [0], Command List: 0x000002455B26C190:'CommandList 2, Allocator 0', SRV/UAV/CBV Descriptor Heap: 0x000002455AF8DBA0:'StaticHeapDX12', Sampler Descriptor Heap: 0x000002455AF8F110:'StaticHeapDX12', Pipeline State: 0x000002455B83A6C0:'TressFXSDFCollision.hlslCollideHairVerticesWithSdf_forward', [ EXECUTION ERROR #942: GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE]

@adam-sawicki-a
Copy link
Collaborator

Does your application work correctly despite these errors reported by the validation?

Returning UINT32_MAX from CalcDefaultPoolIndex causes allocation of all the resources as committed.

If you suspect memory aliasing, please use Allocator::BuildStatsString to get JSON dump with the list of all allocations, their offsets and sizes. You can then validate whether they overlap. But I think this is very unlikely.

@kingofthebongo2008
Copy link
Contributor Author

kingofthebongo2008 commented Oct 21, 2020 via email

@kingofthebongo2008
Copy link
Contributor Author

It may be a bug in the validator with the placed resources and placed resources that you supply virtual addresses directly in the root signature constant. i will confirm this and will reopen if there is something.

@adam-sawicki-a adam-sawicki-a removed the input needed Waiting for more information label Oct 23, 2020
@ForestCSharp
Copy link

I'm also getting a similar issue, but with no adverse side-effects that I've seen in my application.

Always returning UINT32_MAX to force committed resources in AllocatorPimpl::CalcDefaultPoolIndex(...) suppresses these issues (or non-issues, it would seem).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants