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

Heap issue in Nvidia GPU - Star Swarm Benchmark #8

Open
ghost opened this issue Feb 25, 2021 · 7 comments
Open

Heap issue in Nvidia GPU - Star Swarm Benchmark #8

ghost opened this issue Feb 25, 2021 · 7 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Feb 25, 2021

memoryProperties.memoryTypeCount returns 11 heaps, but on the 10th heap the device handle changes abruptly and causes a memory access violation, it only works if I limit it to 9 heaps, below 9 heaps GR_GPU_MEMORY becomes null in grMapMemory()

System information

  • GPU: Nvidia GeForce GTX 1050 Ti
  • Driver: 455.50.07
  • Wine version: wine-tkg-staging-fsync-git 6.2.r5.gaa8a3d90-322 (chaotic-aur)
  • GRVK version: master

Log files

grvk-8-heaps.log
grvk-11-heaps.log

@libcg
Copy link
Owner

libcg commented Feb 25, 2021

Sounds like the same issue reported in #5 (comment)

@libcg
Copy link
Owner

libcg commented Feb 26, 2021

This is a game bug caused by the Nvidia driver exposing a bunch of memory types. It does this because not every type supports every image format, which doesn't map well with Mantle unfortunately, that will need to be handled too.

I'm not sure what's the best way to fix this yet. In the meantime, I could hide the memory types that don't expose all formats. It might work, but the performance will tank on Nvidia.

@sehraf
Copy link

sehraf commented Mar 9, 2021

What bugs me most is the fact that the device pointer goes crazy. Can this - by any chance - be a bug in Star Swam? I mean, why would the device pointer chance at all? Maybe it was not designed for so many heaps? I don't understand why Vulkan differentiates between types and heaps. My naive guess would be that Star Swam expected like 3 instead of 10.

Regarding what to do, my priority would be: Get it running first and care about performance later. Also due to the limited number of games supporting Mantle, a simple list with quirks might work just fine. (Similar to mesa)

@libcg
Copy link
Owner

libcg commented Mar 9, 2021

@sehraf Yes, the invalid pointer is caused by the excessive amount of memory heaps. After thinking about this more, I might not be able to just hide certain heaps. GRVK will need to expose less heaps to the Mantle app and route allocations to the right types behind the scenes.

@libcg libcg added bug Something isn't working enhancement New feature or request labels Mar 15, 2021
@libcg
Copy link
Owner

libcg commented Mar 26, 2021

So, it turns out Mantle only supports up to 8 heaps (GR_MAX_MEMORY_HEAPS=8), which means it's not a game bug but an API limitation. I also found out that the apps will allocate from the correct heap as indicated by grGetObjectInfo before calling grAllocateMemory. It's just a matter of hiding the right heaps and reindexing correctly.

There are 2 good candidates to eliminate out of 11 types:

  • memoryTypes[3] exposes D24 types that are unused in Mantle
  • memoryTypes[9] exposes cached memory
  • not sure what the 3rd one would be?

@sehraf sehraf mentioned this issue Apr 22, 2021
1 task
@sehraf
Copy link

sehraf commented Apr 22, 2021

memoryTypes[3] exposes D24 types that are unused in Mantle

Where do you get that information from? Looking at VulkanCapsViewer memory type 0 to 6 look identical on a RTX 2060.

@libcg
Copy link
Owner

libcg commented Apr 22, 2021

Here's a vulkaninfo dump with the relevant info: nvidia_mem_types.txt

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

No branches or pull requests

2 participants