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

[Question] How to use renderdoc with vulkano for debugging? #924

Closed
arianvp opened this issue Feb 24, 2018 · 7 comments
Closed

[Question] How to use renderdoc with vulkano for debugging? #924

arianvp opened this issue Feb 24, 2018 · 7 comments

Comments

@arianvp
Copy link

arianvp commented Feb 24, 2018

If I try to launch one of the examples to inspect with renderdoc I get the following error:

thread 'main' panicked at 'No instance with surface extension: ExtensionNotPresent', /checkout/src/libcore/result.rs:916:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Warning - send: 111

Just running the executable does work.

Happens both on Wayland and XOrg. FYI

@tomaka
Copy link
Member

tomaka commented Feb 24, 2018

RenderDoc on Windows just works, and it's supposed to be the same on Linux.

It's not impossible that there is a problem in RenderDoc.
Maybe let's ping @baldurk (if you don't mind) just in case they know something about it.

@baldurk
Copy link

baldurk commented Feb 24, 2018

RenderDoc doesn't automatically support all vulkan extensions, only a certain subset, and for device extensions they are filtered automatically to only the supported list. Up until recently RenderDoc had no ability to filter out instance extensions due to how the loader worked (it returned the full list, regardless of whether RenderDoc would then support all of them).

As a half-way compromise, if the application tried to create an instance with an unsupported extension I print an error message and return VK_ERROR_EXTENSION_NOT_PRESENT. It's not exactly accurate or consistent but it's better than a generic VK_ERROR_INITIALIZATION_FAILED or simply crashing.

So my best guess is you're using an instance extension that isn't supported yet. That's nothing vulkano specific, just a limitation of how things worked and the best I could do is an error message & vaguely accurate return value.

I mentioned 'until recently' because the latest loader (1.0.68.0) added the ability to query layers for extension support before returning to the application, so any renderdoc v1.x build from the last month should filter them properly and the results from vkEnumerateInstanceExtensionProperties will be missing the unsupported extensions that you can then handle more gracefully.

@ishanjain28
Copy link

@baldurk I am on arch linux. The latest version of renderdoc available on AUR is 1.0.1 released in March. I get the same ExtensionNotPresent error when I try to load VK_LAYER_RENDERDOC_Capture.

renderdocmd Output

renderdoccmd x64 v1.0 built from NO_GIT_COMMIT_HASH_DEFINED
Packaged for Arch (1.0) - https://aur.archlinux.org/packages/renderdoc
APIs supported at compile-time: Vulkan, GL.
Windowing systems supported at compile-time: xlib, XCB, Vulkan KHR_display.

Nvidia Driver version 390.48

All of my code is here

@baldurk
Copy link

baldurk commented Apr 7, 2018

I don't know rust or vulkano, so maybe I'm missing something, but the code there still doesn't show exactly which extensions you're trying to load (some are implicit from ..vulkano_win::required_extensions()), and it doesn't seem to enumerate the to see which extensions are actually available - assuming you're on the 1.1.70 vulkan loader, enumerating instance extensions should return the right filtered results. You didn't say if you were testing on wayland or not, presumably on wayland the required extensions list will include an extension that isn't supported.

Also FYI you shouldn't directly activate the renderdoc layer like that, it's not an explicit layer that should be referenced by the application, instead you should run your program through the renderdoc UI or CLI tool to make sure it's initialised properly.

@ishanjain28
Copy link

@baldurk I am sorry, I forgot to mention all the information.

I am on X11. The loaded instance extensions are [VK_KHR_surface, VK_KHR_display, VK_KHR_xlib_surface, VK_KHR_xcb_surface, VK_KHR_wayland_surface, VK_EXT_debug_report].

Also FYI you shouldn't directly activate the renderdoc layer like that, it's not an explicit layer that should be referenced by the application, instead you should run your program through the renderdoc UI or CLI tool to make sure it's initialised properly.

Okay, Got it, And Thank you so much for your time.

@baldurk
Copy link

baldurk commented Apr 7, 2018

If you're loading VK_KHR_wayland_surface then that explains the problem since renderdoc doesn't support wayland. You should enumerate available instance extensions first before trying to create an instance, and if you're using a recent loader then renderdoc can filter unsupported extensions out of the enumerated results. That means you can check to make sure extensions are supported and have a better error message with specifically which extension is not supported, or have a fallback path.

Also on X11 I'm not sure why it's asking for VK_KHR_wayland_surface, but I guess that's a vulkano issue.

@ishanjain28
Copy link

ishanjain28 commented Apr 7, 2018

@baldurk You are absolutely correct! The program was crashing when I enabled VK_LAYER_RENDERDOC_Surface and VK_KHR_wayland_surface at the same time.

I tried it again but this time I disabled VK_KHR_wayland_surface and it works fine.

The fix for this should be added in vulkano_win. It is the module responsible for creation of window and it should not enable extensions that are not required/Would never be used.

Thanks again.

Correction: vulkano-win links winit with vulkano.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants