AMD Ryzen CPU and Nvidia RTX 40 GPU on Win10 crashing

I built a new PC with an AMD Ryzen 5600 (which has an Integrated Radeon Graphics Card) CPU and an Nvidia RTX 4070 Ti as my GPU (Windows 10).

I cloned the template and selected Amazon-Coretto 19 as the JDK. The build was fine.
Upon starting, the JVM immediately crashes:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffef9352b60, pid=6828, tid=1108
#
# JRE version: OpenJDK Runtime Environment Corretto-19.0.2.7.1 (19.0.2+7) (build 19.0.2+7-FR)
# Java VM: OpenJDK 64-Bit Server VM Corretto-19.0.2.7.1 (19.0.2+7-FR, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C  [atio6axx.dll+0x192b60]

This is similar to this issue.
However, after updating my AMD and Nvidia drivers the issue didn’t go away.
The line with windows-amd64 makes me suspicious that I am still using the ICG.

Disabling the ICG in my device settings, so that only my Nvidia GPU could possibly be use, circumvented the hard crash and instead lead to “window couldn’t be created”.

So now I am kind of stuck :confused:

Help much appreciated

Kind Regards
Lukas

Hi! Might using a different JDK help? I’ve never used Amazon-Coretto… I used either Temurin or currently adopt-openjdk-14.0.1.

Which version of openrndr and orx are you using? You could try switch to 0.4.4 in the template to see if it makes a difference.

I used the template as it is currently on master. My libs.version.toml starts with:

[versions]
kotlin = "1.8.21"
openrndr = "0.4.3"
orx = "0.4.3"
orml = "0.4.1"

I tried a few JDKs by now. Corretto versions 17, 19 and 20, and jet brains runtime 21 (jbr-21).
Sadly temurin 20 and 16 produced the same error.

This time I noticed that jbr-21 was a bit more verbose with the output:

# (same  as before)
JNI global refs:
JNI global refs: 15, weak refs: 0

JNI global refs memory usage: 835, weak refs: 833

OOME stack traces (most recent first):
Classloader memory used:
Loader bootstrap                                                                       : 16345K
Loader jdk.internal.loader.ClassLoaders$AppClassLoader                                 : 10506K
Loader jdk.internal.loader.ClassLoaders$PlatformClassLoader                            : 28880B

Also going to openrndr/orx version 0.4.4-alpha1 did not resolve it for me.

The error log contains a JNI stacktrace (not very easy to debug, but somewhat insightful):

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.system.JNI.invokePPPP(IIJJJJ)J+0
j  org.lwjgl.glfw.GLFW.nglfwCreateWindow(IIJJJ)J+14
j  org.lwjgl.glfw.GLFW.glfwCreateWindow(IILjava/lang/CharSequence;JJ)J+34
j  org.openrndr.internal.gl3.ApplicationGLFWGL3.createPrimaryWindow()V+183
j  org.openrndr.internal.gl3.ApplicationGLFWGL3.<init>(Lorg/openrndr/Program;Lorg/openrndr/Configuration;)V+210
j  org.openrndr.internal.gl3.ApplicationBaseGLFWGL3.build(Lorg/openrndr/Program;Lorg/openrndr/Configuration;)Lorg/openrndr/Application;+18
j  org.openrndr.ApplicationBuilderKt.application(Lkotlin/jvm/functions/Function1;)V+51
j  TemplateProgramKt.main()V+6
j  TemplateProgramKt.main([Ljava/lang/String;)V+0
v  ~StubRoutines::call_stub 0x000001a9b01d100d

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0xffffffffffffffff

I figured out two separate problems, which I was able to solve and like to share :slight_smile:

  1. Why is OPENRNDR crashing with EXCEPTION_ACCESS_VIOLATION ?
    → This is a driver issue of your GPU/CPU misinterpreting memory allocation.
    In my case, the Windows Update only updated the latest drivers for my BIOS version (MSI B550 from 2019). I went to the MSI site where I downloaded the latest B550 BIOS and flashed it. Afterward a restart, I got a popup for new AMD drivers and was able to update it.

  2. Why is OPENRNDR using the wrong GPU ?
    → If you have multiple GPUs you can either select it in the Nvidia Control Panel, AMD Radeon Settings (or whatever Intel is using for their Arc series graphics cards) or potentially the Windows “Graphics Settings”.
    I had the trickier setup with an Nvidia and an AMD on the same computer, so neither vendor menu saw the other’s GPU. I always started with the drastically less performant one: OpenGL renderer: AMD Radeon(TM) Graphics

I took the command that starts the application (the first line in the terminal when running in IntelliJ) which tells you which executable is used:
C:\Users\Lukas\.jdks\corretto-19.0.2\bin\java.exe …

In the Windows Graphics Settings, I added it to my preference list and selected the GPU manually.

Thanks to @Abe for the support <3
I also liked the hint with trying out the Demo suite for LWJGL 3. It clears your mind from your project crashing specifically - most of the examples crashed too. It was an hardware issue.

I’m so happy to be back to working on my stuff !

1 Like

Yay! I’m happy that you made it work!

Enjoy the gigahertzs and adventurous computations! :stuck_out_tongue: :smile:

Just to add 2 cents, I had a similar problems (on win11) with AMD wx3200 with pro drivers crashing openrndr programs. Initialy I blamed lack of support for latest version of JDK by lwjgl3 but yesterday installing the latest Adrenalin driver solved issue. This actually might be something with native code on lwjgl side that AMD doesn’t like as I’ve been recently messing with new Java native api (writing some custom bindings to raylib and abusing it quite heavly) and I haven’t seen single crash.

1 Like