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

panic: vkInit failed #5

Closed
davidmanzanares opened this issue Jul 21, 2017 · 7 comments
Closed

panic: vkInit failed #5

davidmanzanares opened this issue Jul 21, 2017 · 7 comments

Comments

@davidmanzanares
Copy link

I don't know if I have installed it correctly, but I get this error:
~/Go/src/demos/vulkancube/vulkancube_desktop $ go run main.go
panic: vkInit failed
...

I'm using Linux with a Nvidia 1070 (375.66 drivers) and GLFW 3.2 with OpenGL 4.5 works fine. I just cloned the repo and run "go get -u" in the vulkancube_desktop folder.

Do you know what could be the problem?

Thanks!

@davidmanzanares
Copy link
Author

I found a solution, but I don't understand it very well. The solution is to source VulkanSDK/1.0.54.0/setup-env.sh before running it. If I've understood it correctly, that will set an environment variable with the VulkanSDK path, so the executable can find the loader?

This step is strange for me. I don't know if this behavior is similar in just C, but, it isn't similar in OpenGL.
Could you answer some questions?
What is the purpose of the library code inside the VulkanSDK? I thought that GLFW was responsible for loading the function pointers (and all the window-related stuff), and that the GPU driver was responsible for providing these function pointers... Is VulkanSDK just a middle-man between GLFW and the driver? Is it just used when GLFW gets function pointers at initialization time? When and who loads all the function pointers?
If I want to redistribute a program... should I redistribute the VulkanSDK and "source" the setup-env.sh?

Thank you

@xlab
Copy link
Member

xlab commented Jul 21, 2017

Hi, I will need the whole panic stack, you could remove catcher.Catch to get them. Also Go version is required to know.

Oh yes, btw GLFW vulkan loader uses X11 to obtain surface via Xcb, so you need to run with DISPLAY=:0 vulkancube_desktop

@xlab
Copy link
Member

xlab commented Jul 21, 2017

If wayland, figure out the proper env vars. Rule of thumb there is that vulkan surface must be obtained from a window server , make sure your cli binaries can discover it.

@xlab
Copy link
Member

xlab commented Jul 21, 2017

@dv343 sorry I didn't see your message before posted my ideas.
Could you please provide source of env.sh there?

@xlab
Copy link
Member

xlab commented Jul 21, 2017

@dv343 I found the file, it simply adds a path with libvulkan.so provided by VulkanSDK of LunarG to LD search path.

You should have installed official NVidia drivers that support vulkan out of the box and provide their own libvulkan.so into standard /usr/lib path. Drivers also contain required modules to Xorg.

On their site with driver versions nvidia states the vulkan support for each driver version. I was able to run vulkan on Amazon GPU computing cloud using drivers for K20 or a card like that..

@xlab
Copy link
Member

xlab commented Jul 21, 2017

What is the purpose of the library code inside the VulkanSDK?

It provides libvulkan.so that is a loader, it discovers ICDs like Xorg.
See https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/loader/LoaderAndLayerInterface.md

Currently it's already reasonable to use an official loader from nvidia drivers.

GLFW -> libvulkan.so -> ICDs (e.g. Xorg + driver)

@davidmanzanares
Copy link
Author

Thanks for the info!

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