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

Mock ICD fails some simple operations #84

Open
null77 opened this issue Oct 30, 2018 · 8 comments
Open

Mock ICD fails some simple operations #84

null77 opened this issue Oct 30, 2018 · 8 comments
Assignees
Labels
enhancement New feature or request MockICD

Comments

@null77
Copy link
Contributor

null77 commented Oct 30, 2018

The Mock ICD works well for a few simple use cases but breaks down on some workloads.

One simple example is allocating and writing to a buffer larger than 0x1000. This will trigger errors. I think handling arbitrary sizes should be something the Mock ICD should be able to support without too much trouble.

A second example is mapping memory ranges. After a first map call that writes to the data, the memory is discarded and subsequent map calls return junk data. It seems plausible for the Mock ICD to store some state associated with the device memory.

In both cases the application on top of the Mock ICD needs to know specifically that it is running on top of the mock ICD to work without errors. This seems counter to the intent of the mock ICD. It should be basically invisible apart from not executing commands.

@tobine @ShabbyX @y-novikov fyi

@tobine tobine added the enhancement New feature or request label Nov 2, 2018
@tobine
Copy link
Contributor

tobine commented Nov 2, 2018

For historical context note that the original motivation for the Mock ICD was to allow validation layer tests to be run. That goal made cutting corners such as these reasonable.
Now that Mock ICD has spun into Tools repo by itself and is being used more broadly it makes sense to add these enhancements. Let me know if there's any time pressure, otherwise I've added this to my queue following some higher priority work.

@null77
Copy link
Contributor Author

null77 commented Nov 2, 2018

Yep, sounds good. Thanks Tobin.

@KarenGhavam-lunarG
Copy link
Contributor

Now that swiftshader exists, it probably makes more sense to see if that path is a solution.

The Mock ICD was not ever intended for the use case of this original issue.

@null77
Copy link
Contributor Author

null77 commented Jan 20, 2020

Hey Karen,

SwiftShader's current set of uses do not include making a mock ICD. The Mock ICD could more easily be extended to cover a slightly more robust use case than SwiftShader could be reorganized to support dropping command streams. I think we should leave this open as a feature request as there's a pretty solid need for a mock ICD in the ecosystem.

@KarenGhavam-lunarG
Copy link
Contributor

Ok. I will leave open for now.

@null77
Copy link
Contributor Author

null77 commented Jan 20, 2020

Thank you!

@rumblehhh
Copy link

rumblehhh commented Jul 8, 2022

Has there been anymore recent investigation into any of the limitations of the Mock ICD that @null77 pointed out?

A second example is mapping memory ranges. After a first map call that writes to the data, the memory is discarded and subsequent map calls return junk data. It seems plausible for the Mock ICD to store some state associated with the device memory.

This seems to play havoc when combined with VMAs VMA_DEBUG_DETECT_CORRUPTION feature which wasn't immediately obvious

@charles-lunarg
Copy link
Contributor

Unfortunately no, I haven't had time to modify Mock ICD since my focus has been on the loader.
I'd be happy to review/accept any PR's that come in however.

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

No branches or pull requests

5 participants