M1 Support Workaround

Greetings Lightship Community.

You haven’t heard from me before but I’m on one of the many engineers who develops the Lightship platform and I come bearing gifts. While not full support for all ARDK Editor features here’s a workaround which will at least prevent your Editor from crashing when you import the ARDK on M1 Macs running either through Rosetta or with the new 2021.2.X for the M1.

Steps:

  • Create your project

  • Import the ARDK (Unity will crash)

  • Download the linked zip file - m1patch.zip (872 Bytes)

  • Unzip the contents in your project root (directory which contains Assets directory)

    • unzip -o <pathto>/m1patch.zip
  • Restart unity

We’re still working on full native support but we figured sharing a workaround would be helpful in the meantime.

I specifically tested this on 2019.4.23f1 and 2021.2.0f1 (Apple Silicon). If you try it on something else and it doesn’t work, please report back and we’ll try to get a revised patch posted.

Happy Holidays,
Ben

22 Likes

This is the best news - comes just a few days after my new M1 Macbook arrived :smiley:

Will test this out this weekend!!! If I can use my new fast Macbook to test… dev is going to get way faster and smoother! Thank you so much for this!

1 Like

Hi Ben!

Just wanted to say a MASSIVE thank you for this patch. Can confirm that I’ve been able to get my GeoGlitched project to build on both 2019.4.23f1 and 2021.2.0f1. Will keep building and progressing with 2021.2.0f1 and see how things go, but I’ve been able to get it to build to my iPhone and all without issues :slight_smile:

Thanks again!
Patrick

1 Like

Hello, thanks for the fix.

but I still have a problem on my M1 mac mini 16gb with Unity 2020.3.22f1 and Unity 2021.1.27f1 after I applied the patch on my downloaded project with ardk1 from my collab repo, unity still crashes

Can you try the process with our Getting Started project and see if that works? The idea here being to narrow down whether it’s an issue with our plug-in or some other aspect of your project.

Have you tried with the M1 native 2021.2.X? I fought with this a little before realizing the issue, but the 2021.2.X release for the M1 can only be acquired with Unity Hub 3.0 (still in beta) or you have to download it manually.

It seems that I unzipped the m1patch.zip as you suggested it but my folder structure was different. now it works. So the fix also works for me.

Thank you very much. This is helping a lot

@Chris_Prenissl Oh excellent! What was different about your folder structure? I developed my patch based on our publicly released test projects. Curious how your project was structured differently.

I don’t know why it is different but here is how the root folder is structured:

when I applied the patch in the root folder a seperate ARDK folder was created. I took the files from the folder and moved them to my ARDK subfolders and replaced the ones with the same name.

thanks again:)

It’s different because you’ve installed your ARDK into an extra layer of subdirectory (we don’t do that internally, we actually don’t check in the ARDK to our development repositories at all and inject it where we need it with scripting to make it easier to update). We’ll have the library load part of this fix integrated into our next release, but you’ll still need the .csc files in the zip dumped into your Assets directory.

Hey guys I actually had crash on importing ARDK in Unity since I have an M1 but I followed the directions and downloaded the 2021.2.3f1 for Silicon chip (M1) in the Unity Hub 3.0 Beta. And now I’m able to import the ARDK without even crashing and without using the patch!

Now don’t get too excited cause now I have a new issue which is I get a black screen when I run an ARDK scene as if there was no active camera. I do see the buttons and other UI element in the player window but clearly I don’t have the mockup environement showing up as I should…

So I tried to restart the same project after applying the patch to it but this doesn’t solve my issue.

I’d be curious to find out if other people were able to replicate this behavior and if Ben_Lau you might have any idea of what could be going on. Thanks again for your help and for having shared with us your patch which seems to do it for some people.

Ok so I tried to reinstall the exact same version that Ben_Lau used in workaround (2021.2.0f1 Apple Silicon) and when I import ARDK it doesn’t crash either but asks me for a “Script Update Consent”. The details of the message are the following:
"Some of this projects source files refer to API that has changed. These can be automatically updated. It is recommended to have a backup of the project before updating. Do you want these files to be updated?

Assets/ARDK/Rendering/RenderTarget.cs
Assets/ARDK/Networking/HLAPI/Object/Unity/Helpers/NetworkedUnityObjectEditor.cs
Assets/ARDK/AR/AwarenessBufferProcessor.cs
Assets/ARDK/AR/Awareness/_AwarenessBufferHelper.cs"

@Ben_Lau could you tell us when we see that message should say yes or no?

@Arnaud_Paris While I can’t speak for Ben directly, I’m pretty sure I clicked “Yes” with that popup and it worked for me :+1: (Just have things backed up in source control of course if you’re running a project you don’t want to lose progress in if the update doesn’t work).

Thanks Patrick, so did you also observe the same behaviour where you didn’t have to apply the patch to have the ARDK up and running in your project?

For me, I don’t get the black screen issue you’re having - but for me the editor didn’t immediately crash in 2021.2.3f1 either (I thought it might have been because I’d already put the patch in before it had a chance to crash but it could just be the crash happens later?).

I got the crash in the 2019.4.23f1 though every time.

My project at the moment is running in 2021.2.3f1 after the patch. It was an existing project that I ported across, not sure if that changes whether or not you’d get the black screen issue!

I haven’t tried 2021.2.3f1. The project I’m working on at the moment requires a ton of disk space on my M1 so I’ve been having to juggle installed copies of Unity and I currently have none installed. I’m surprised that 2021.2.3f1 is able to load without the patch… since without it we should be trying to load a library which is fundamentally incompatible with arm64. Maybe they made a change in 2021.2.3f1 which forces it to not load a library which is incompatible with the architecture? I probably don’t have time to investigate the behavior in further detail, since as I said this is a workaround I discovered while working on the longterm solution to this issue. I don’t see anything obvious in the release notes, but that’d be my theory if you’re not seeing crashed.

As @Patrick_Catanzariti pointed it out it’s fine to update to scripts when working with 2021. I think I had to do that too… but that was days ago and I don’t quite remember (it’s been a busy weekend).

@Arnaud_Paris As for your black screen issue, I’d suggest raising that in the #im-stuck forum and that should get it in front of one of our client engineers. You wouldn’t know it from what I do for a living but I’m actually a Unity noob. :slight_smile: I just know a lot about very particular parts of Unity, like how to manage CLI builds and how the library loader works.

I’ve found that removing the ‘MacOS’ plugin folder (‘ARDK\Plugins\unity_exports\ardk_client_platform\Plugins\MacOS’) allows me to launch ARDK projects in Unity and make builds no problem. I haven’t tried it in all varieties of Unity though, just 2019.4

@Arnaud_Paris Have you seen this thread? There are others who seem to have had the black screen issue - Build of a example scene from the project gives me a black screen - #6 by Joe_Gabriel

@Thomas_Hall that’s a curious find! I wonder why that works!

My theory there is that this is really about the library not being found. The patch essentially changes the library name it’s looking for from ardk_client_platform to TODO_DOES_NOT_EXIST. So if you remove the library entirely, you kind of get the same behavior. :slight_smile:

I tried different builds above 2021.2.0f1 and I’m able to load the ARDK without using the patch in all of them so I think using the patch once does the trick for all following unity installs that used to crash.