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

Instance creation fails with VK_ERROR_LAYER_NOT_PRESENT #760

Closed
raphlinus opened this issue Apr 10, 2021 · 3 comments
Closed

Instance creation fails with VK_ERROR_LAYER_NOT_PRESENT #760

raphlinus opened this issue Apr 10, 2021 · 3 comments

Comments

@raphlinus
Copy link

Environment information:

  • AGI version: Version 1.0.0:4ddd08c5546200a14141b75639a4b758fb2fadd2
  • Host OS: Windows 10
    If tracing on Android:
  • Device model: Pixel 4
  • Android Version: 11, RQ2A.210305.006

Bug description
When creating a Vulkan instance when started from AGI, the vkCreateInstance call fails with VK_ERROR_LAYER_NOT_PRESENT.

Reproduction steps
Steps to reproduce the behavior:

  1. Check out Add example Android apk linebender/vello#82. Install "cargo apk" tool, and build this APK with cargo apk run --example android.
  2. Try to capture trace using AGI.
  3. Activity crashes with VkError(ERROR_LAYER_NOT_PRESENT)

Note: this is a Vulkan app written in Rust, using the ash bindings. It's entirely possible I'm doing something wrong. I have been able to get validation output, using the steps outlined in Vulkan validation layers on Android. I'm also able to capture traces from the spinning cube demo bundled with AGI.

Looking at the instance creation code, I'm not doing anything particularly funny, or different from the sample code here. I get the same error whether I ask for the VK_LAYER_KHRONOS_validation layer or not.

Stacktrace

04-09 20:32:12.047 31036 31062 D vulkan  : searching for layers in '/data/user/0/rust.example.android'
04-09 20:32:12.047 31036 31061 I RustStdoutStderr: window = 0xb40000766d589020, 1080x2280
04-09 20:32:12.047 31036 31062 D vulkan  : searching for layers in '/vendor/app/gpu_profiling_vulkan_layer/gpu_profiling_vulkan_layer.apk!/lib/arm64-v8a'
04-09 20:32:12.049 31036 31062 D vulkan  : added global layer 'VkRenderStagesProducer' from library '/vendor/app/gpu_profiling_vulkan_layer/gpu_profiling_vulkan_layer.apk!/lib/arm64-v8a/libVkLayer_q3dtools_so.so'
04-09 20:32:12.049 31036 31062 D vulkan  : searching for layers in '/data/app/~~u9OMoTMhBKnGy-2GL86-6g==/rust.example.android-08PnddxEwwV-EOhACNrUyw==/lib/arm64'
04-09 20:32:12.054 31007 31009 I cmd     : oneway function results will be dropped but finished with status OK and parcel size 4
04-09 20:32:12.054 31036 31062 D vulkan  : added global layer 'VK_LAYER_KHRONOS_validation' from library '/data/app/~~u9OMoTMhBKnGy-2GL86-6g==/rust.example.android-08PnddxEwwV-EOhACNrUyw==/lib/arm64/libVkLayer_khronos_validation.so'
04-09 20:32:12.055  1554  1579 I chatty  : uid=1000(system) android.bg expire 1 line
04-09 20:32:12.056 31036 31062 D vulkan  : searching for layers in '/data/app/~~u9OMoTMhBKnGy-2GL86-6g==/rust.example.android-08PnddxEwwV-EOhACNrUyw==/base.apk!/lib/arm64-v8a'
04-09 20:32:12.057 31036 31061 I RustStdoutStderr: layer: LayerProperties { layer_name: "VkRenderStagesProducer", spec_version: 4194304, implementation_version: 8192, description: "Render Stages Producer" }
04-09 20:32:12.057 31036 31061 I RustStdoutStderr: layer: LayerProperties { layer_name: "VK_LAYER_KHRONOS_validation", spec_version: 4194425, implementation_version: 1, description: "LunarG validation Layer" }
04-09 20:32:12.057 31036 31061 I RustStdoutStderr: # layers = 1
04-09 20:32:12.057 31036 31061 I RustStdoutStderr: thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: VkError(ERROR_LAYER_NOT_PRESENT)', piet-gpu\bin/android.rs:22:15

Additional debugging information

gapic.log
gapis.log
logcat-full2.txt

@hevrard
Copy link
Contributor

hevrard commented Apr 10, 2021

Could you give a quick try to our "dev-releases" see if that unblocks you? You can grab the latest AGI dev-release from:
https://github.com/google/agi-dev-releases/releases/latest

Please let us know if the bug reproduces with the latest dev-release.

@hevrard
Copy link
Contributor

hevrard commented Apr 10, 2021

I tried cargo-apk but it seems to systematically fail, whichever the args I give to it:

~/work/piet-gpu (android2)$ cargo-apk run --example android
Error: Invalid args.
~/work/piet-gpu (android2)$ cargo-apk build
Error: Invalid args.

@raphlinus
Copy link
Author

The new version works, thanks!

To reproduce, you don't call cargo-apk directly, but use cargo: so "cargo apk run --example android". It does also need to be in the piet-gpu subdirectory of the repo for that to work.

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

No branches or pull requests

2 participants