Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
197 views
in Technique[技术] by (71.8m points)

Vulkan Device Simulation: Why might I be having memory map failures when using a simulation of my own device

I have found the extension VK_LAYER_LUNARG_device_simulation to be a godsend in replicating issues found on other devices - I'm using an RTX 2080 and have been able to successfully replicate an issue on an AMD 5700.

However, for fun I thought I would try using a device file for the same model device I have, and I am getting buffer mapping errors, specifically ERROR_MEMORY_MAP_FAILED when trying to map a buffer that has been successfully created, of size 65536 bytes).

There is no such error when not using the device simulation layer. I don't have the memory mapping failure when using the amd 5700 simulation file.

Any ideas on whether this is a false positive, or something I should look into more deeply?

I've since found the debug output flag for device simulation (environment variable VK_DEVSIM_DEBUG_ENABLE=1), which lets me see some warnings about some json values being higher than existing, the only pertinent ones seemed to be heap sizes, which are zero when loaded.

If I set the heap size to zero in the file, I can't allocate anything because the heap is then restricted to zero size.

If I remove the section VkPhysicalDeviceMemoryProperties from the file, I don't see the issue.

I've now cross posted on the LunarG issues page, so there is some more detailed output here.

question from:https://stackoverflow.com/questions/65600940/vulkan-device-simulation-why-might-i-be-having-memory-map-failures-when-using-a

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is more than one model of the RTX 2080 and it is possible that you are using a DevSim simulation file that has memory types that are incompatible with your hardware.

You can see the RTX 2080 variants on gpuinfo.org. Click on "Memory" and note that some have 5 memory types and some have 11. You may have simply obtained the wrong simulation file.

Another possibility is that you may be using a simulation file for the correct device, but it may be out of date with respect to your driver version. This is somewhat less likely because memory type support shouldn't change that often across driver versions. But it could happen.

You can verify that either explanation is the case by running vulkaninfo on your device without any DevSim simulation and comparing the Memory Type information it reports against that in the DevSim simulation file. If they are different, then that would explain the problem you are seeing. You should then find the correct simulation file, or you could "hack" the simulation file to match your hardware, and then it should work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...