vulkan-go / demos

Vulkan API crossplatform demos in Go

Home Page:https://vulkanGo.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panic: vkInit failed

davidmanzanares opened this issue · comments

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!

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

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

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.

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

@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..

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)

Thanks for the info!