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

Add setting to cache the GPUMemory mappings for pipeline upload #78

Closed
wants to merge 1 commit into from

Conversation

samikhawaja
Copy link

During pipeline upload the GpuMemory is allocated from the pool. This
memory is mapped, pipeline is uploaded and then the memory is unmapped.
In applications with lots of pipelines being created during rendering,
this causes lots of map/unmap calls and slows down the pipeline upload.

Add a setting that allows the cache of the GpuMemory mapping, so that it
can be reused by another pipeline upload.

@samikhawaja
Copy link
Author

Fixes: #72

@amdvlk-admin
Copy link

Can one of the admins verify this patch?

@JaxLinAMD
Copy link
Contributor

ok to test

@amdvlk-admin
Copy link

Test summary for commit 749cfb4

Driver commits used in build
  • CWPACK: amd-master 7387247eb9889ddcabbc1053b9c2052e253b088e
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • LLPC: dev 31c298b0905752b64c16011b6bb3cdf597817654
  • SPVGEN: dev bb3da8bc00bcf4373d563bf9b3c74a80a8b28fe6
  • XGL: dev 5dbd470d8c1cbf8ee5d9a1204ba23a2fbf88a242
  • LLVM-PROJECT: amd-gfx-gpuopen-dev 01f326c1e88cbf80e50a631ea0ce61a57152a7c0
CTS tests (Failed: 0/227984)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 31680/56996 (55.6%)
    • Failed: 0/56996 (0.0%)
    • Not Supported: 25316/56996 (44.4%)
    Ubuntu 18.04, Gfx9
    • Passed: 31677/56996 (55.6%)
    • Failed: 0/56996 (0.0%)
    • Not Supported: 25319/56996 (44.4%)
    Ubuntu 20.04, Gfx8
    • Passed: 32051/56996 (56.2%)
    • Failed: 0/56996 (0.0%)
    • Not Supported: 24945/56996 (43.8%)
    Ubuntu 20.04, Gfx103
    • Passed: 34932/56996 (61.3%)
    • Failed: 0/56996 (0.0%)
    • Not Supported: 22064/56996 (38.7%)

@JakeMerdichAMD
Copy link
Contributor

I'm in favor of this change, but am also concerned that this will grow unboundedly-- many of our systems in the wild still have limited BAR space and thus limited GPU memory that they can CPU-map at a time.

Either only doing this when we don't have this limitation (no invisible memory) or having some scheme to eventually unmap the memory so we don't have this issue would resolve this in my mind.

@samikhawaja
Copy link
Author

The mapped memory is unmapped when the internal memory manager is destroyed. But in general since the maximum pool size is large enough the later memory allocations will be serviced by already allocated pools.

Also if needed to enable this only when required, I have added a new pal setting that disables it by default.

@RobMartin-AMD
Copy link

RobMartin-AMD commented Jul 15, 2021

The mapped memory is unmapped when the internal memory manager is destroyed. But in general since the maximum pool size is large enough the later memory allocations will be serviced by already allocated pools.

Also if needed to enable this only when required, I have added a new pal setting that disables it by default.

Some AAA game titles have very large numbers of pipelines (sometimes tens of thousands). Even with large pools of memory, there could still be a large number of these pools active simultaneously. Keeping these allocations mapped essentially forever (because the internal memory mgr is not destroyed until the parent Device is destroyed) can be detrimental on some platforms which this code base has to support.

Having the setting is nice, but a better option would be to have a limit on the number of these large pools which can remain mapped. If we maintained a list of open mappings, and released the least-recently-used mapping when we exceeded our maximum, we'd be able to have most of if not all of the benefits of this change, without any of the potential drawbacks. If this maximum were controllable via a PAL setting, then we could set the maximum to zero in cases where we might need to disable this functionality.

@samikhawaja
Copy link
Author

The mapped memory is unmapped when the internal memory manager is destroyed. But in general since the maximum pool size is large enough the later memory allocations will be serviced by already allocated pools.
Also if needed to enable this only when required, I have added a new pal setting that disables it by default.

Some AAA game titles have very large numbers of pipelines (sometimes tens of thousands). Even with large pools of memory, there could still be a large number of these pools active simultaneously. Keeping these allocations mapped essentially forever (because the internal memory mgr is not destroyed until the parent Device is destroyed) can be detrimental on some platforms which this code base has to support.

Having the setting is nice, but a better option would be to have a limit on the number of these large pools which can remain mapped. If we maintained a list of open mappings, and released the least-recently-used mapping when we exceeded our maximum, we'd be able to have most of if not all of the benefits of this change, without any of the potential drawbacks. If this maximum were controllable via a PAL setting, then we could set the maximum to zero in cases where we might need to disable this functionality.

Makes sense. I have updated this to use a maxNumMappedPool setting to decide the maximum number of mapped pools. Pools are unmapped based on least recently used scheme.

@amdvlk-admin
Copy link

Test summary for commit 53cefe3

Driver commits used in build
  • CWPACK: amd-master 7387247eb9889ddcabbc1053b9c2052e253b088e
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • LLPC: dev 72afd4ae01e3f5c043dbd2dfac57833408ac3f6b
  • SPVGEN: dev bb3da8bc00bcf4373d563bf9b3c74a80a8b28fe6
  • XGL: dev 5dbd470d8c1cbf8ee5d9a1204ba23a2fbf88a242
  • LLVM-PROJECT: amd-gfx-gpuopen-dev 01f326c1e88cbf80e50a631ea0ce61a57152a7c0
CTS tests (Failed: 336/227984)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 31596/56996 (55.4%)
    • Failed: 84/56996 (0.1%)

      Failures:

      FAILURE: dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
      Stack trace: Script:
      Allocations still remain, failed on index 155
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.instance
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_group
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_memory_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_uniform_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_storage_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_3d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube_arr
      Stack trace: Script:
      Invalid allocation callback
      
      ...
      

    • Not Supported: 25316/56996 (44.4%)
    Ubuntu 18.04, Gfx9
    • Passed: 31593/56996 (55.4%)
    • Failed: 84/56996 (0.1%)

      Failures:

      FAILURE: dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
      Stack trace: Script:
      Allocations still remain, failed on index 550
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.instance
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_group
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_memory_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_uniform_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_storage_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_3d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube_arr
      Stack trace: Script:
      Invalid allocation callback
      
      ...
      

    • Not Supported: 25319/56996 (44.4%)
    Ubuntu 20.04, Gfx8
    • Passed: 31967/56996 (56.1%)
    • Failed: 84/56996 (0.1%)

      Failures:

      FAILURE: dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
      Stack trace: Script:
      Allocations still remain, failed on index 155
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.instance
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_group
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_memory_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_uniform_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_storage_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_3d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube_arr
      Stack trace: Script:
      Invalid allocation callback
      
      ...
      

    • Not Supported: 24945/56996 (43.8%)
    Ubuntu 20.04, Gfx103
    • Passed: 34848/56996 (61.1%)
    • Failed: 84/56996 (0.1%)

      Failures:

      FAILURE: dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
      Stack trace: Script:
      Allocations still remain, failed on index 155
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.instance
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_group
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_memory_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_uniform_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_storage_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_3d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube_arr
      Stack trace: Script:
      Invalid allocation callback
      
      ...
      

    • Not Supported: 22064/56996 (38.7%)

@amdvlk-admin
Copy link

Test summary for commit fa620f7

Driver commits used in build
  • CWPACK: amd-master 7387247eb9889ddcabbc1053b9c2052e253b088e
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • LLPC: dev 72afd4ae01e3f5c043dbd2dfac57833408ac3f6b
  • SPVGEN: dev bb3da8bc00bcf4373d563bf9b3c74a80a8b28fe6
  • XGL: dev 5dbd470d8c1cbf8ee5d9a1204ba23a2fbf88a242
  • LLVM-PROJECT: amd-gfx-gpuopen-dev 01f326c1e88cbf80e50a631ea0ce61a57152a7c0
CTS tests (Failed: 336/227984)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 31596/56996 (55.4%)
    • Failed: 84/56996 (0.1%)

      Failures:

      FAILURE: dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
      Stack trace: Script:
      Allocations still remain, failed on index 155
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.instance
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_group
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_memory_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_uniform_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_storage_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_3d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube_arr
      Stack trace: Script:
      Invalid allocation callback
      
      ...
      

    • Not Supported: 25316/56996 (44.4%)
    Ubuntu 18.04, Gfx9
    • Passed: 31593/56996 (55.4%)
    • Failed: 84/56996 (0.1%)

      Failures:

      FAILURE: dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
      Stack trace: Script:
      Allocations still remain, failed on index 550
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.instance
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_group
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_memory_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_uniform_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_storage_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_3d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube_arr
      Stack trace: Script:
      Invalid allocation callback
      
      ...
      

    • Not Supported: 25319/56996 (44.4%)
    Ubuntu 20.04, Gfx8
    • Passed: 31967/56996 (56.1%)
    • Failed: 84/56996 (0.1%)

      Failures:

      FAILURE: dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
      Stack trace: Script:
      Allocations still remain, failed on index 155
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.instance
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_group
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_memory_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_uniform_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_storage_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_3d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube_arr
      Stack trace: Script:
      Invalid allocation callback
      
      ...
      

    • Not Supported: 24945/56996 (43.8%)
    Ubuntu 20.04, Gfx103
    • Passed: 34848/56996 (61.1%)
    • Failed: 84/56996 (0.1%)

      Failures:

      FAILURE: dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
      Stack trace: Script:
      Allocations still remain, failed on index 155
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.instance
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_group
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.device_memory_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_uniform_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_small
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_storage_large
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_uniform_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.buffer_view_storage_r8g8b8a8_unorm
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_3d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_1d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_2d_arr
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube
      Stack trace: Script:
      Invalid allocation callback
      
      
      FAILURE: dEQP-VK.api.object_management.single_alloc_callbacks.image_view_cube_arr
      Stack trace: Script:
      Invalid allocation callback
      
      ...
      

    • Not Supported: 22064/56996 (38.7%)

@amdvlk-admin
Copy link

Test summary for commit a19f205

Driver commits used in build
  • CWPACK: amd-master 7387247eb9889ddcabbc1053b9c2052e253b088e
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • LLPC: dev 72afd4ae01e3f5c043dbd2dfac57833408ac3f6b
  • SPVGEN: dev bb3da8bc00bcf4373d563bf9b3c74a80a8b28fe6
  • XGL: dev 5dbd470d8c1cbf8ee5d9a1204ba23a2fbf88a242
  • LLVM-PROJECT: amd-gfx-gpuopen-dev 01f326c1e88cbf80e50a631ea0ce61a57152a7c0
CTS tests (Failed: 0/227984)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 31680/56996 (55.6%)
    • Failed: 0/56996 (0.0%)
    • Not Supported: 25316/56996 (44.4%)
    Ubuntu 18.04, Gfx9
    • Passed: 31677/56996 (55.6%)
    • Failed: 0/56996 (0.0%)
    • Not Supported: 25319/56996 (44.4%)
    Ubuntu 20.04, Gfx8
    • Passed: 32051/56996 (56.2%)
    • Failed: 0/56996 (0.0%)
    • Not Supported: 24945/56996 (43.8%)
    Ubuntu 20.04, Gfx103
    • Passed: 34932/56996 (61.3%)
    • Failed: 0/56996 (0.0%)
    • Not Supported: 22064/56996 (38.7%)

Copy link

@RobMartin-AMD RobMartin-AMD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change doesn't conform to the PAL coding standards. Please update it so that it does. You can review the standards here: https://github.com/GPUOpen-Drivers/pal/blob/dev/doc/process/palCodingStandards.md

src/core/internalMemMgr.cpp Show resolved Hide resolved
src/core/internalMemMgr.cpp Outdated Show resolved Hide resolved
src/core/internalMemMgr.h Outdated Show resolved Hide resolved
src/core/internalMemMgr.cpp Outdated Show resolved Hide resolved
@samikhawaja samikhawaja force-pushed the issue_72 branch 2 times, most recently from d107728 to b3626e7 Compare July 20, 2021 15:38
@samikhawaja
Copy link
Author

I have also change the max logic from number of pools to the size of mapped pools.

Copy link

@RobMartin-AMD RobMartin-AMD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, just a few minor formatting nits. I realize these may seem arbitrary or unnecessary, but the rationale behind them is to enforce a consistent style throughout all of PAL. Doing so helps maintain the readability of the codebase for all developers, internal and external to AMD. It is much appreciated.

Thanks for your patience on this.

src/core/internalMemMgr.cpp Outdated Show resolved Hide resolved
src/core/internalMemMgr.cpp Show resolved Hide resolved
src/core/internalMemMgr.cpp Show resolved Hide resolved
src/core/internalMemMgr.cpp Show resolved Hide resolved
src/core/internalMemMgr.cpp Outdated Show resolved Hide resolved
src/core/internalMemMgr.cpp Outdated Show resolved Hide resolved
src/core/internalMemMgr.cpp Outdated Show resolved Hide resolved
src/core/settings_core.json Show resolved Hide resolved
@samikhawaja
Copy link
Author

Mostly looks good, just a few minor formatting nits. I realize these may seem arbitrary or unnecessary, but the rationale behind them is to enforce a consistent style throughout all of PAL. Doing so helps maintain the readability of the codebase for all developers, internal and external to AMD. It is much appreciated.

Thanks for your patience on this.

Makes perfect sense, really appreciate the detailed review.

Copy link

@RobMartin-AMD RobMartin-AMD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me.

@jinjianrong -- What additional testing (if any) is required before this can be marked as approved?

@JaxLinAMD
Copy link
Contributor

I 'll re-trigger the test ( retest this please)
@JakeMerdichAMD @RobMartin-AMD please approve it if there is no problem

@amdvlk-admin
Copy link

Test summary for commit 12c9330

Driver commits used in build
  • CWPACK: amd-master 7387247eb9889ddcabbc1053b9c2052e253b088e
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • LLPC: dev 7569f1e64a840f4918ea6549ad3b9630758c6de9
  • SPVGEN: dev bb3da8bc00bcf4373d563bf9b3c74a80a8b28fe6
  • XGL: dev 5dbd470d8c1cbf8ee5d9a1204ba23a2fbf88a242
  • LLVM-PROJECT: amd-gfx-gpuopen-dev 4f968af13313fd60f4a661943745d252ad14f2af
CTS tests (Failed: 0/225188)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 31329/56297 (55.6%)
    • Failed: 0/56297 (0.0%)
    • Not Supported: 24968/56297 (44.4%)
    Ubuntu 18.04, Gfx9
    • Passed: 31329/56297 (55.6%)
    • Failed: 0/56297 (0.0%)
    • Not Supported: 24968/56297 (44.4%)
    Ubuntu 20.04, Gfx8
    • Passed: 31712/56297 (56.3%)
    • Failed: 0/56297 (0.0%)
    • Not Supported: 24585/56297 (43.7%)
    Ubuntu 20.04, Gfx103
    • Passed: 34555/56297 (61.4%)
    • Failed: 0/56297 (0.0%)
    • Not Supported: 21742/56297 (38.6%)

RobMartin-AMD
RobMartin-AMD previously approved these changes Jul 22, 2021
@@ -2019,4 +2036,4 @@
"Description": "Maximum string length for a miscellaneous string setting"
}
]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @samikhawaja could you tell me how you made this change in your editor? I can't tell the difference between the two lines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just a trailing newline. No functional change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The coding standard above doesn't say anything about the trailing new line. I can remove it if this is not ok.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is ok, no need to change it any more :)

@JaxLinAMD
Copy link
Contributor

retest this please

2 similar comments
@JaxLinAMD
Copy link
Contributor

retest this please

@JaxLinAMD
Copy link
Contributor

retest this please

@JaxLinAMD
Copy link
Contributor

/rebase

@JaxLinAMD
Copy link
Contributor

@samikhawaja could you rebase your branch?

During pipeline upload the GpuMemory is allocated from the pool. This
memory is mapped, pipeline is uploaded and then the memory is unmapped.
In applications with lots of pipelines being created during rendering,
this causes lots of map/unmap calls and slows down the pipeline upload.

Add a setting that allows the cache of the GpuMemory mapping, so that it
can be reused by another pipeline upload.
@samikhawaja
Copy link
Author

@samikhawaja could you rebase your branch?

Sure. Rebased the branch on dev.

@amdvlk-admin
Copy link

Test summary for commit e129c53

Driver commits used in build
  • CWPACK: amd-master 39f8940199e60c44d4211cf8165dfd12876316fa
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • LLPC: dev 665ea8970f411bb9cbb08be8e75016d8cb09a4d2
  • SPVGEN: dev 580ade71d630a304805e9468ef22ad263c37d137
  • XGL: dev 04534321e450d220d404a240a047c7e1cd82f3fd
  • LLVM-PROJECT: amd-gfx-gpuopen-dev c6950e03a4c97beadc88a8bf5bea3dc5aa2649ee
CTS tests (Failed: 0/225376)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 32541/56344 (57.8%)
    • Failed: 0/56344 (0.0%)
    • Not Supported: 23803/56344 (42.2%)
    • Warnings: 0/56344 (0.0%)
    Ubuntu 18.04, Gfx9
    • Passed: 32381/56344 (57.5%)
    • Failed: 0/56344 (0.0%)
    • Not Supported: 23962/56344 (42.5%)
    • Warnings: 1/56344 (0.0%)
    Ubuntu 20.04, Gfx8
    • Passed: 32717/56344 (58.1%)
    • Failed: 0/56344 (0.0%)
    • Not Supported: 23627/56344 (41.9%)
    • Warnings: 0/56344 (0.0%)
    Ubuntu 20.04, Gfx103
    • Passed: 35698/56344 (63.4%)
    • Failed: 0/56344 (0.0%)
    • Not Supported: 20646/56344 (36.6%)
    • Warnings: 0/56344 (0.0%)

@amdvlk-admin
Copy link

e129c53 Jenkins build error.
/jenkins/workspace/vulkan/sanitized-opensource/Github-PR/pal-github-pr/driver_build/drivers/pal/src/core/libInit.cpp:64:95: error: static assertion failed: The specified PAL_CLIENT_INTERFACE_MAJOR_VERSION is not supported.
64 | static_assert((PAL_CLIENT_INTERFACE_MAJOR_VERSION >= PAL_MINIMUM_INTERFACE_MAJOR_VERSION) &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
65 | (PAL_CLIENT_INTERFACE_MAJOR_VERSION <= PAL_INTERFACE_MAJOR_VERSION),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[222/3024] Building CXX object pal/CMakeFiles/pal.dir/src/core/internalMemMgr.cpp.o

@amdvlk-admin
Copy link

e129c53 Jenkins build error.
/jenkins/workspace/vulkan/sanitized-opensource/Github-PR/pal-github-pr/driver_build/drivers/pal/src/core/libInit.cpp:64:95: error: static assertion failed: The specified PAL_CLIENT_INTERFACE_MAJOR_VERSION is not supported.
64 | static_assert((PAL_CLIENT_INTERFACE_MAJOR_VERSION >= PAL_MINIMUM_INTERFACE_MAJOR_VERSION) &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
65 | (PAL_CLIENT_INTERFACE_MAJOR_VERSION <= PAL_INTERFACE_MAJOR_VERSION),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[221/3091] Building CXX object pal/CMakeFiles/pal.dir/src/core/image.cpp.o

@jinjianrong jinjianrong closed this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants