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

macOS (and arm64) Support - Feature Request #11

Closed
ilgrandeanonimo opened this issue May 21, 2024 · 8 comments
Closed

macOS (and arm64) Support - Feature Request #11

ilgrandeanonimo opened this issue May 21, 2024 · 8 comments
Assignees
Labels
compatibility Mod compatibility issue enhancement New feature or request

Comments

@ilgrandeanonimo
Copy link

Today i tried to use this mod on my M1 Mac but the game crash because it requires the ARM64 version

[22:58:41] [Render thread/ERROR]:
 Unhandled game exception
java.lang.UnsatisfiedLinkError: dlopen(/Users/{COMPUTER_USERNAME}/Library/Application Support/com.modrinth.theseus/meta/natives/1.20.6-0.15.11/jna15495653446642276667.tmp, 0x0009): tried: '/Users/{COMPUTER_USERNAME}/Library/Application Support/com.modrinth.theseus/meta/natives/1.20.6-0.15.11/jna15495653446642276667.tmp' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/{COMPUTER_USERNAME}/Library/Application Support/com.modrinth.theseus/meta/natives/1.20.6-0.15.11/jna15495653446642276667.tmp' (no such file), '/Users/{COMPUTER_USERNAME}/Library/Application Support/com.modrinth.theseus/meta/natives/1.20.6-0.15.11/jna15495653446642276667.tmp' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
	at com.sun.jna.Native.open(Native Method) ~[jna-5.14.0.jar:?]
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:300) ~[jna-5.14.0.jar:?]
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:481) ~[jna-5.14.0.jar:?]
	at com.sun.jna.Library$Handler.<init>(Library.java:197) ~[jna-5.14.0.jar:?]
	at com.sun.jna.Native.loadLibrary(Native.java:668) ~[jna-5.14.0.jar:?]
	at com.sun.jna.Native.loadLibrary(Native.java:652) ~[jna-5.14.0.jar:?]
	at club.minnced.discord.rpc.DiscordRPC.<clinit>(DiscordRPC.java:42) ~[com_github_minndevelopment_java--rpc-v2.0.2-15f21a422df796c6.jar:?]
	at me.splitque.presencium.discord.<clinit>(discord.java:8) ~[presencium-2.0.jar:?]
	at me.splitque.presencium.main.lambda$onInitialize$0(main.java:15) ~[presencium-2.0.jar:?]
	at net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents.lambda$static$0(ClientLifecycleEvents.java:35) ~[fabric-lifecycle-events-v1-2.3.4+c5fc38b3b0-b28198e202c52719.jar:?]
	at net.minecraft.class_310.handler$zll000$fabric-lifecycle-events-v1$onStart(class_310.java:7258) ~[client-intermediary.jar:?]
	at net.minecraft.class_310.method_1514(class_310.java:870) ~[client-intermediary.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:265) [client-intermediary.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) [fabric-loader-0.15.11.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.15.11.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.15.11.jar:?]
@ilgrandeanonimo
Copy link
Author

My fault, confused

@Richy-Z Richy-Z self-assigned this Jul 15, 2024
@Richy-Z Richy-Z added wontfix This will not be worked on compatibility Mod compatibility issue labels Jul 15, 2024
@Richy-Z
Copy link
Member

Richy-Z commented Jul 15, 2024

I wanted to reopen this issue to inform future users that this mod isn’t fully supported on macOS. While it does work on M series Macs due to the platform-independent nature of JAR files (which can run on almost anything, even Samsung Smart Fridges), the mod performs a platform check and only supports up to OpenGL 4.1 on macOS. This limitation is due to Apple’s decision to drop OpenGL in favour of the Metal API (similar to DirectX or Vulkan) back in the Mojave era, leaving OpenGL support capped at version 4.1. This is not a restriction imposed by me, Minecraft, OpenGL, GLFW, or any other entity, but Apple.

@Richy-Z Richy-Z pinned this issue Jul 15, 2024
@Richy-Z Richy-Z changed the title arm64 Support - Feature Request macOS (and arm64) Support - Feature Request Jul 15, 2024
@ilgrandeanonimo
Copy link
Author

Maybe is possible to use MetalAPI in Java

@Richy-Z
Copy link
Member

Richy-Z commented Jul 17, 2024

That's an intriguing concept that I looked into a while ago. Unfortunately, it is impossible because there are no Metal Framework bindings for Java. The closest thing I could find was Project Lanai and JEP 382, but both are absolutely useless in our case because they are simply the implementation of Metal to replace OpenGL in 2D Java Applications. Additionally, it is incredibly limited and the Project Lanai wiki makes it hard to understand what it is - it's as if they're obscuring what the project actually entails. They could have simply written, "Project Lanai is the attempt to implement Metal to replace OpenGL for 2D Java Applications on macOS," but instead, it is a disorganized mess of information on an obscure, outdated wiki.

I'd love to see something like Vulkan mod except Metal for macOS one day, if bindings become available. The performance impact for M series Macs would be immense.

TL;DR: Can't make a Metal Mod for Minecraft because of no available bindings for Java. Looked at Project Lanai but that's only for 2D.

@ilgrandeanonimo
Copy link
Author

Maybe is possible to use Metal APIs in Java by mixing Java with Swift https://github.com/SwiftJava or C++

@Richy-Z
Copy link
Member

Richy-Z commented Jul 18, 2024

SwiftJava would not be applicable in this instance as it only uses a bit a Java in Swift, not vice versa. However, the C++ option might be feasible because if I recall correctly, there is a Metal Library for C++ which we could potentially use using JNI. It would be a lot of work but I'm sure the developers of Vulkan mod toiled endlessly to get their mod working too, sooo... 😅😅

It would definitely be a great learning experience for me.

@ilgrandeanonimo
Copy link
Author

If you prefer to use Swift they just announce this new package for interoperability https://github.com/swiftlang/swift-java at SwiftConf

@Richy-Z
Copy link
Member

Richy-Z commented Sep 27, 2024

That seems like an interesting thing. I'll see how difficult it is when I have some spare time.

@Richy-Z Richy-Z added enhancement New feature or request and removed wontfix This will not be worked on labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Mod compatibility issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants