-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
NearMenu/RadialView/Solvers break in ARM64 Release mode #7624
Comments
Interesting...the combination of repro scenarios you lay out makes me think there's some race condition somewhere? In slower configurations (ARM vs ARM64, debug vs release, development mode vs not) it doesn't repro, but does in ARM64 + release. |
Agree... My initial hunch was that it might have something to do with the RadialView Another (probably lower chance) possibility is that some code optimization between release / debug or casting between 64-bit and 32-bit might be causing things to go awry? |
BTW, I upgraded my project from MRTK v2.0.0 to v2.3.0 when this started happening and the |
Did you update Unity versions as well, or just MRTK around that time? |
I did go from Unity 2019.2.13f1 to Unity 2019.3.7f1 as well. |
Sorry, I just noticed that for now the issue was only mentioning radial view but my guess is, that my comment is still valid as this seems to infect more than radial view only. |
我也碰到这个问题。 |
Hi, Had the Hololens 2 for a couple of weeks to try it out and can't test on it anymore. But the smoothing worked fine in the editor play mode, but not when deployed to the HL2. Built with Master|ARM64 I think... I also recall that there were some other component that had similar problem, I think it was the surface magnetism as well (the object disappeared when the magnetism was activated), and when disabling the smoothing then it worked as expected again. Cheers, |
yes @c11epm that solves it for me (with different solvers I use) thanks! If I've time later I'll try to track this down! |
@cefoot and @c11epm , I unchecked the" Smoothed Eye Tracking"setting in the Eye Gaze Provider section of the Configuration Profile and that fixed it. Even though I did not change the smoothing setting in my Radial View components. I think this also happened on a different occasion when I had RadialView components both on the parent AND a child object simultaneusly, but that seemed like a reasonable outcome. |
I confirmed this in 2019.3.10f1. This looks like and IL2CPP bug (or god forbid an ARM64 compiler bug) when generating code for Solver.UpdateWorkingScaleToGoal or UpdateWorkingPositionToGoal. In my case, the the position update was setting a GoalPositon of (0.0, 0.0, 0.1) which was then flattening out some objects when it was applied to the GoalScale. The work around suggested above works. If there is anybody left in Seattle I'd suggest trying to work out what the heck, as SmoothTo is used in a few places and might produce weird behavior elsewhere. |
From the HoloDevelopers Slack mixed-reality-toolkit channel: |
What I found out, that if I build the exact same VS solution from So I think it's more of a visuals studio bug than an MRTK bug. |
I can confirm I was using VS2019.5.4, well snap ARM64 compiler bug? I'll try and test ARM tomorrow (but I Unity 2019.3 ARM builds were broken last time I checked). |
@keveleigh Did we find any more information about this bug? I hit this bug in an app that was upgraded to MRTK 2.3. Created a new scene with just a Slate: It scales to zero as soon as the "Follow me" button is hit. The hand menu solvers also scale to zero. Building with ARM solved the issue. I had also tried reinstalling MRTK from Nuget and that seemed to fix the issue for some reason... |
@srinjoym Unfortunately, I haven't had time to really dig in yet.
Which version were you upgrading from? And did you happen to change Unity versions at the same time?
Huh... |
I have yet to be able to repro this with Unity 2018.4.x and Visual Studio 16.5.5 (granted, this was targeting ARM not ARM64). I built both Release and Master flavors. I will try again using 2019.3.x and ARM64. |
@matware, can you try installing the 16.5.5 release of VS and let us know if you see the same issue? I would recommend a clean build to ensure that if this is a compiler issue, there is nothing left over :) |
I can confirm this with Release | ARM64 on current (16.5.5) Visual Studio |
I am also not seeing hand menus when building ARM64 for master. |
@wiwei Testing report. Really looks like ARM64 has been compromised for a while now. Obviously it has not been tested very well. I would not bet it being the compiler's issue. It seems to have been consistently unstable for a good long time. Also the fact that ARM also has issues on the same code makes me suspicious of the Unity implementation. |
@laultman Does this issue then seem to be anyhow related to the Lerp function? Or is this arbitrary? |
@Holo-Fiedel please read my earlier comment which links to the analysis of what's going on: https://developercommunity.visualstudio.com/content/problem/1128346/arm64-c-164-165-regression.html The issue affects the Lerp functions in a particularly bad way, but are not only specific to that. |
From what I can tell, folks on the VS compiler team are looking at this issue now. |
@wiwei Hopefully this will get narrowed down so it can truly be fixed. I tested today Unity 2019.2.21 and VS 2019 16.7.2 using the MRTK example HandJointChaser which uses the Radial View and solver handler. Aside from the fact that MRTK examples are so old they referenced obsolete Tracked Target Types, which after fixing the ARM version ran perfectly. ARM64 would not track. I then turned off Smoothing on just one finger (IndexTipChaser) and it at least (ARM64) rendered something, weird planes and track objects in all directions. I would venture to say it was hosed. |
@wiwei Just tried my tests again with Unity 2019.9f1 with VS 2019 16.7.2 with same results as previous tests, ARM functions as expected while ARM64 shows static objects, menus are not visible. |
The complier team suggested: In the VS generated C++ project, try adding the following command line switch: /d2ssa-cfg-jt- |
The compiler team said this: "They did ask (if you haven’t done it already) to please upvote the issue here https://developercommunity.visualstudio.com/content/problem/1128346/arm64-c-164-165-regression.html, So as to help drive the customer impact for a fix." |
Looks like there's an update! https://developercommunity.visualstudio.com/comments/1168945/view.html |
The compiler switch option worked for me! A Unity project with enabled Smoothing on a RadialView had not been working on ARM64/Release before applying this workaround, but afterwards, the application was interactive without any performance issues. Enabling the compiler option has been achieved by execution of the following steps: The solution will be built completely new, but afterwards, the issues mentioned in this thread had no longer been encountered within my project. |
If anyone within the next week wants to try a fix, lemme know here. We have some binary drops with the fix (i.e. to help verify that it addressed the issue for folks). A few caveats that this is not intended for long term use, comes as-is, and probably a bunch of other things in terms of level of support etc. It's mostly just to build confidence in the compiler fix having the right end effect several layers up the stack. |
I can try it. Let me know how you want to proceed. |
Actually wait, I just heard that there's some challenges to that - it looks like the recommended thing is probably to do what @Xenyr wrote while we wait for VS update. Sorry for that! I should have double-checked with other folks first before that last post. |
It just gets more fun, Unity Build Settings generates the wrong version for VS if you have more than one VS version side-by-side. I have VS 2019 v16.4.5 (supposedly does not have the bug), v16.7.2, and v16.8.0 (Preview) on my box. After nothing seemed to work including the fix, I found that in the .sln file Unity generates always is the highest minor version. So no matter what version you open on your desktop the .sln will override. Your NMAKE will then choose the wrong compiler and linker. Check the top of your build output. FYI the fix has not worked for me on the correct compiler/linker. @wiwei |
I can confirm Xenyr's workaround indeed works! Nice friggin work! I was about to write my own lerping systems to salvage what little functionality was left in the hand tracking systems... now work's back on track! Thanks to everyone who helped track down this issue. Looks like they've found and fixed the problem for upcoming realeases - " at this point it's expected that this will appear in an upcoming 16.8 preview, and then all future releases" |
Thanks to @Xenyr for sharing the workaround! Yep, it looks like the fix made it onto a future release train, which will be great. We can keep this issue open until it gets out into a non preview release (just so that folks who run into this can still see this pinned to the top and know what's going on) |
It looks like with some 2.5 changes, this issue is affecting more of the toolkit, so I've opted to add an auto-magic workaround that will automatically apply the workaround you identified. You will need to have the "Tools" package (i.e. I opted not to put this in the Foundation package) |
Thank you for taking care of this issue! For my part, I installed the "Tools" package in my project, so I appreciate just updating the MRTK instead of always applying the workaround manually. Will you mention the "Tools" package requirement for the affected smoothing functionality in the documents on GitHub so that new users don't stumble over this bug until VS2019 16.8 is released? |
This issue is fixed in Visual Studio 16.8 and later which is now released. |
Describe the bug
In the NearMenuExampleScene, there seems to be a race condition causing an issue only seen in Release mode ARM64 where the menus disappear from view when they are unpinned.
During investigations, I noticed that the scale of the menu would go to (0,0,0.3) instead of 1,1,1 causing the menu to disappear completely or sometimes, the menu would be stuck at a weird angle for a bit and then disappear completely.
It looks like the issue is related to RadialView since I found it when I was upgrading a project from v2.0.0 to v2.3.3 and my menu bar was never showing up since it had RadialView on it. So, it does not seem related to the NearMenu prefabs in any way. After a ton of debugging, I realized it was happening in the stock MRTK repo itself.
The issue seems to repro only with ARM64, Release and when the app is built in Unity without development mode on. It does not repro when built for ARM, or when built for Debug or when built with Unity Development Mode + Script debugging.
To reproduce
A) Clone the repo, open and build the NearMenuExamples scene for ARM64, Release and deploy to a HL2. Try to unpin one or more of the menus displayed in the scene
B) Create a new project in Unity using the instructions in the Getting Started guide and import the MRTK Foundation and MRTK Examples packages. Then, build for ARM64, Release and deploy to HL2. Try to unpin one or more of the menus displayed in the scene.
Expected behavior
See videos below
Videos
REPRO: Arm64, Release, Vanilla Project with MRTK unitypackages: https://youtu.be/WAaUk4ChLkk
REPRO: Arm64, Release, MRTK Repo checked out at v2.3.0: https://youtu.be/tMJBf6YXvLM
NO REPRO: Arm64, Debug, Vanilla Project with MRTK unitypackages: https://youtu.be/XlW5iN6SEgM
NO REPRO: Arm64, Debug, MRTK Repo checked out at v2.3.0: https://youtu.be/BoffJwdd0X4
Your setup (please complete the following information)
Target platform (please complete the following information)
The text was updated successfully, but these errors were encountered: