-
Notifications
You must be signed in to change notification settings - Fork 393
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
Validation layer does not like AMD memory allocation strategy on Intel IGP? #990
Comments
I just found that the AMD memory allocator example traps this error and ignores it.. It does not make me happy to do this.. |
To be honest I don't think this should be a warning at all, given how limited Vulkan default memory allocation support is. |
This doesn't happen just with integrated graphics, it behaves the same way on my discrete graphics. |
Vulkan only lets you map a memory allocation once, necessitating VMA mapping the whole allocation rather than just a subrange. |
@tobine, can we nuke this warning, or move it to the Assistant layer maybe? |
After reviewing the spec a few times I'm not certain what motivated that warning. I suspect the original motivation for the warning has since changed in the spec. I'm fine with just nuking it. |
PR coming. |
As mentioned in the abandoned PR #1006, this warning is actually called out in the spec:
So the consensus is to leave the warning as-is. |
So, should I then report this as a bug to AMD memory allocation library? I mean, either them, the spec or the validation layer has to be wrong here.. |
IMO it is a validation layer bug if this is reported as an error, because there really is no such error in Vulkan. If it is reported a warning that's less objectionable, but it's the kind of thing where it adds more confusion than it helps. |
As @Tony-LunarG described in his comments, this might be one of those things that the memory manager needs to do even though it generates valid warnings. But yes, that might be the best place to address it, as the layers need to cover the operation of all applications. |
@jeffbolznv, it is a warning. I'll run it past @tobine again -- I feel similarly about all the warnings - they usually upset just as many folks as they help. |
Opened an issue on the AMD memory allocator: |
HOLD ON A SECOND HERE! I see 5 distinct problems here:
I suspect it is valid to map but invalid to access, and if that's the case then the error message should be changed to a warning, and the wording of the message should be changed to be more clear. Right now it indicates it is invalid to map if the device uses this region, regardless of whether the host touches the region. If it's invalid to map, the Vulkan API in the spect has a serious problem. |
@darksylinc, it is a warning, see closed PR #1006, or the original issue description at the top of these comments. If we don't remove the warning, then perhaps a rewording will help. |
I know the warnings are meant to be helpful, but it seems like the trend is "if something is valid, somebody will do it, and the warnings will be considered a bug". As for what the spec says, my interpretation is "it's valid to map, it's even valid to access, you just get undefined data in your image". The mapping needs to be allowed in order to share memory with buffers and I think it's weird to flag it as a warning just because some image is bound to the memory. |
@mark-lunarg I see. I re-read the log and it is indeed a warning. I am not advocating for removing the warning. And indeed, a rewording would help, since the warning implies it is invalid to even map; whereas it is more likely that it is illegal to touch that region of memory from the CPU if the device is using it. |
@jeffbolznv, I agree entirely, will advocate again for removal, and need to build some consensus with some other stakeholders -- thanks again for the information and support. |
My view on this is that warnings are useful when they advocate best practices. This seems to have been so far the case with all the other warnings I have found in the validation layer, but it doesn't seem to be the case here. |
According to @adam-sawicki-amd on his comment below, there isn't any possible best practice here to follow, as this is per Vulkan design: GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator#64 (comment) If this is the case, then I'm not sure this is useful as a warning, I believe it should be something of less importance. |
We have removed this warning from corechecks and will add it to the assistant layer (see tracking issue #24), where best-practices and API pitfalls are collected together. Thanks for all the feedback. |
My understanding is that:
So I support removal of this warning. Thanks Mark for handling this! |
I'm doing the following:
I get this error:
I have the feeling that AMD allocator is putting both the image and the staging buffer together in host memory due to this being an IGP. Still, I don't know how to work around this warning so.. what is the recommended strategy?
The text was updated successfully, but these errors were encountered: