Hello Guest

Which version of Vulkan is supported by the latest snapshot of LWJGL?

  • 9 Replies
  • 540 Views
I have installed the latest daily snapshot of LWJGL but all the Vulkan demos cause the JVM itself to crash.

Is this because recent versions of Vulkan are not yet supported? I have the latest version on Windows.

Or is there some other reason why all the Vulkan demos crash the JVM but the OpenGL ones work properly?

I have tried with JDKs 8, 9, 10 & 11.

*

Offline spasi

  • *****
  • 2124
    • WebHotelier
Re: Which version of Vulkan is supported by the latest snapshot of LWJGL?
« Reply #1 on: December 27, 2018, 11:43:24 »
The latest snapshot supports Vulkan 1.1.95. Which Vulkan demo are you testing? Could you post any stacktraces or attach the JVM crash dump that you're getting? You may also want to try running with -Dorg.lwjgl.util.Debug=true -Dorg.lwjgl.util.DebugLoader=true.

Re: Which version of Vulkan is supported by the latest snapshot of LWJGL?
« Reply #2 on: December 28, 2018, 10:19:59 »
All the Vulkan demos fail in a manner like this using Vulkan 1.1.85.0:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000072697a36, pid=31280, tid=31140
#
# JRE version: Java(TM) SE Runtime Environment (10.0.1+10) (build 10.0.1+10)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (10.0.1+10, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [nvoglv64.dll+0xb07a36]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\Workspaces\LWJGL\hs_err_pid31280.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Process finished with exit code 1



The LWJGL error report is attached.

Any help would be appreciated!

*

Offline spasi

  • *****
  • 2124
    • WebHotelier
Re: Which version of Vulkan is supported by the latest snapshot of LWJGL?
« Reply #3 on: December 28, 2018, 13:35:46 »
What hardware are you running the demos on? Are the Nvidia drivers up-to-date? Note that the Vulkan SDK version is not related to what the driver or hardware actually support.

In any case, it's crashing inside the Nvidia driver so I don't think this is an issue with LWJGL. You could try running a native Vulkan demo to verify.

Re: Which version of Vulkan is supported by the latest snapshot of LWJGL?
« Reply #4 on: December 28, 2018, 20:24:22 »
Thanks.

My NVIDIA drivers are always kept up to date.

I also have several Vulkan samples (some written by NVIDIA themselves) and they all work with no errors or crashes.

Why would the NVIDIA driver crash (apparently) due to something with LWJGL?

*

Offline spasi

  • *****
  • 2124
    • WebHotelier
Re: Which version of Vulkan is supported by the latest snapshot of LWJGL?
« Reply #5 on: December 28, 2018, 23:34:48 »
I tried the demos earlier and could reproduce the crashes. Enabling the Vulkan SDK validation layers (with -Dvulkan.validation=true) seems to indicate an issue with the included SPIR-V modules. Asked httpdigest (the maintainer of lwjgl3-demos) and he mentioned that the shaders were compiled 3 years ago and a recompilation may resolve the issue.

Re: Which version of Vulkan is supported by the latest snapshot of LWJGL?
« Reply #6 on: December 29, 2018, 01:21:53 »
Thanks, it's good to know it's not just me!

But when you say the demos may need to recompiled, what do you mean exactly?

Is someone going to do this recompilation or can I do this myself?

*

Offline KaiHH

  • ***
  • 181
Re: Which version of Vulkan is supported by the latest snapshot of LWJGL?
« Reply #7 on: December 29, 2018, 10:34:46 »
I've fixed and rebuilt the shaders which made the demos work again. When enabling validations, there are however some vkCmdPipelineBarrier() errors, which do not seem to have any effect on the rendering however.

Re: Which version of Vulkan is supported by the latest snapshot of LWJGL?
« Reply #8 on: December 29, 2018, 19:32:38 »
Thanks @KAIHH - I can confirm that the Vulkan demos are working again.

Just so I can learn, could you explain exactly what you needed to do?  Then if it ever happens again, may be I can fix it and not bother anyone.

*

Offline KaiHH

  • ***
  • 181
Re: Which version of Vulkan is supported by the latest snapshot of LWJGL?
« Reply #9 on: December 30, 2018, 09:57:16 »
Recompiling the GLSL/SPIR-V shaders. For that you need a GLSL -> SPIR-V compiler. I took https://github.com/google/shaderc, built it and used the glslc frontend included in the build with:
Code: [Select]
@echo off
for %%i in (*.vert;*.frag) do glslc -c %%i
That gave rise to some errors in the GLSL shader code, which may of course be wildly different when encountering another situation of them not working anymore in the future.
See the commit: https://github.com/LWJGL/lwjgl3-demos/commit/fdb9579a9b9c56c1ea86f54ddf34aff8f1f67920