Sodium

Sodium

44M Downloads

Crash when a graphics adapter is present which does not support OpenGL

D2Lx0wse opened this issue ยท 15 comments

commented

Bug Description

The game crashes with this error
A mod crashed on startup! net.fabricmc.loader.impl.FormattedException: java.lang.RuntimeException: Could not execute entrypoint stage 'preLaunch' due to errors, provided by 'sodium'! at net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:63) at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:162) at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68) at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100) at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129) at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) Caused by: java.lang.RuntimeException: Could not execute entrypoint stage 'preLaunch' due to errors, provided by 'sodium'! at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$2(FabricLoaderImpl.java:388) at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:386) at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:160) ... 5 more Caused by: java.lang.NullPointerException: Cannot invoke "String.matches(String)" because "driverName" is null at me.jellysquid.mods.sodium.client.compatibility.checks.PreLaunchChecks.findIntelDriverMatchingBug899(PreLaunchChecks.java:123) at me.jellysquid.mods.sodium.client.compatibility.checks.PreLaunchChecks.onGameInit(PreLaunchChecks.java:60) at me.jellysquid.mods.sodium.client.SodiumPreLaunch.onPreLaunch(SodiumPreLaunch.java:13) at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384) ... 6 more

Reproduction Steps

  1. Download ARM64 Prism Launcher and a ARM64 build of java 21 on a snapdragon pc
  2. Install minecraft 1.21 with fabric and the attached mods
    image

image

  1. Launch the game
  2. Fabric crashes

Log File

latest.log

Crash Report

The game does not produce a crash report, or gets to the main menu. Here's my specs?!?!?
image
image
the opengl is not the best but it say it's compatible

commented

Are you not using the latest version of Sodium? Please upload the entire log file, not the snippet. It has critical information.

commented

We do not have anyone on our team who has access to these recent laptops with Qualcomm's Snapdragon chips. It will be impossible for anyone to debug this without the information that our issue template asks for.

commented

image

commented

This is not a X elite laptop, as you can see in the specs, it's from 2022, also minecraft only produced the log I attached as file as it crashed so early, I tried to send all info I could

commented

Sorry. The email that was sent to me about your issue did not include the link to the log file for some reason.

commented
[19:14:16] [main/INFO]: Found graphics adapter: AdapterInfo{vendor=UNKNOWN, description='Adreno 680', adapterType=0x0000230B, openglIcdFilePath='null', openglIcdVersion=null}

Do the Adreno drivers actually support OpenGL? It seems like they don't, and Windows is using a translation layer on top of it (OpenGL on D3D12, probably), which confuses Sodium...

commented

I think the graphics adapter probe in Sodium is just bugged, and it doesn't account for the possibility that a GPU may not actually support OpenGL.

Marking these fields as @Nullable and then adding null-checks where the fields are accessed would likely be enough.

commented

I have no idea, if sodium checked if the driver name string was null
image
(since thats where it's erroring) could it launch? I acknowledge it'd possibly be broken cause no translation layer- oh you said it as I was typing

commented

I can confirm that this issue also occurs on the new Qualcomm Snapdragon X Elite (X1E78100) systems.
image

Here are my system specs:
image

commented

Also, it appears that OpenGL does work, since vanilla 1.21 runs just fine. It appears to be using Mesa for the OpenGL translation layer as well.

image

commented

Is there a chance that the translation layers belong in a different "virtual" adapter? I'm curious how the full virtual adapter list looks like, null exception aside. Otherwise, is there really no way to poll information on GLon12 support for the given platform?

FWIW, internally, on context creation, it does seem to make a difference between a native OpenGL driver and GLon12: https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/ne-d3dkmthk-_d3dkmt_clienthint
(Although this specific hint enum seems irrelevant for sodium.)

commented

I built the latest version of the mod using Intellij, and it somehow isn't crashing? The driverName is detected correctly here, but launching the game through PrismLauncher still crashes.

image

Regardless of this weird behavior, I believe it can be fixed easily by just checking if driverName is null, and continuing the loop if it is. The function that it's crashing in seems to only be for detecting Intel drivers, so this shouldn't break any existing behavior.

commented

I'm nominating this issue for critical prioritization so that we can make a backport exception for older versions.

commented

If you run into this issue, you can add the following entry to your JVM arguments:

-Dsodium.checks.issue899=false

This disables the broken pre-launch check and allows the game to launch (somewhat) normally.

commented

The mod crashing on new hardware platforms is not acceptable for me and this problem is likely manifesting elsewhere with drivers that don't actually support OpenGL natively.