Apple Silicon

RSS for tag

Build apps, libraries, frameworks, plug-ins, and other executable code that run natively on Apple silicon.

Posts under Apple Silicon tag

200 Posts

Post

Replies

Boosts

Views

Activity

If an app bundle is copied from its original location it will not be able to launch on M1
We have not been able to launch any of the applications we build using the most recent build tools and platform. To be specific, this problem occurs with Xcode 13.4.1 or newer on macOS Monterey 12.6 (possibly earlier as well) with a Silicon processor. On a similar Intel machine, there is no issue. The symptom is as follows: If the application is built entirely in Xcode and not copied anywhere, it does launch successfully (same thing applies if it is moved into another location). But if it is copied somewhere else, its icon just bounces forever and nothing else happens. Apparently the program launcher (launchd, I suppose) is for some reason unable to launch the application, or it refuses to do so. Even so, no complaints are found in the log file for launchd. We usually build our applications using command line build tools and a specially crafted scripts for putting files into the application bundle, code signing and notarising. It is of course critical for us that we can put together and distribute our applications to machines running on a Silicon processor, so any help will be greatly appreciated. The problem is easily reproduced. Simply create an application from the macOS App template in Xcode. Then locate the app bundle somewhere beneath the folder ~/Library/Developer/, and copy it to another location on the machine. You will not be able to launch the copy of the application.
8
0
2.6k
Oct ’22
C code running significantly slower on M1 mac than old i7
Hey guys, trying to find some help with this as I can't find anything anywhere. I am following BlueFever Software's online videos about making a chess engine in C. I've gotten to the point where we're performing what's called Perft Testing where the MoveGenerator is tested for issues. When running those tests, I noticed that the time it takes my M1 mac to perform said test is multiple times slower than even the video(which was made in 2013 on a Dual-core). I tried running the exact same program on my i7 laptop(which I bought in 2016), and it's at least 50 times faster. Running Activity Monitor, I can see that the program is using 100% of the available CPU and like 400GB of virtual RAM. A link to the exact code can be found here: https://github.com/JensDevWoW/Vice Not sure what makes this run so badly on the M1 Mac, hoping someone might be able to provide some insight: INFO: Main computer: M1 Chip, 8GB Memory, macOS Monterey 12.4, compiled using Apple Clang with X Code Laptop: i7, 16GB RAM, Windows 10, compiled using gcc on Visual Studio 2019
0
0
710
Sep ’22
Project doesn't archive, complains about architecture
I have a SwiftUI project, iOS16, it builds fine if I choose a simulator/device, but when I choose Any iOS Device (arm64) and hit Archive, it fails with error: error build: Entry point (_main) undefined. for architecture arm64 I'm using an M1 Mac Studio to build it. I have the following in my main: @main struct MyAppNameApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate ... } class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Sets cache for Images downloader SDWebImageSwiftUI // ... return true } } Under Architectures I have the following: Should I select for release Yes as well? Why is it failing? What setting do I have to look into? Thanks
2
0
1.4k
Sep ’22
Mac App Store url problem on Mac M1
Hello, I have an iOS application which has a "rate us" button. This button redirects to "Write review" section on the app's App Store. It is working great on both iPhone and iPad devices. The problem is on MacBook M1 - it is working, but once the App Store app for review is opened, my iOS app crashes :( UIApplication.shared.open(URL(string: "itms-apps://itunes.apple.com/us/app/app-name/id*****?action=write-review")!) Any ideas on how it can be fixed? Thanks!
11
1
3.8k
Sep ’22
Reset permissions for iOS apps installed on Apple Silicon Mac
UI flows can be built around requesting permissions for, for example, camera or microphone access in iOS apps. With Xcode 14, it's super easy to run an app on an Apple Silicon Mac with the device "My Mac (Designed for iPhone)". However, how do you reset camera permissions to new install state for an iOS app installed and run that way on Mac? Naturally, removing the app from the Products folder does not remove its row in Settings -> Security and Privacy -> Camera on MacOS and disabling camera access via that row sets AVCaptureDevice.authorizationStatus to denied and not notDetermined even with a fresh install.
2
0
1.9k
Sep ’22
Random hangs on M1 in Apple Accelerate when performing sparse Cholesky factorization
Hello, I'm trying to use Accelerate's sparse Cholesky solver but met an issue on M1. Is anyone aware of this issue or similar ones? The sparse factorization class _SparseNumericFactorSymmetric in Apple Accelerate will hang randomly for some large symmetric positive definite matrices with a specific sparsity pattern when created for Cholesky factorization. This issue happens in probability about 1/1000. It can be reproduced through following steps Read and load the attached sparse matrix (in MatrixMarket format). In a for-loop, repeatedly factorize the same matrix through _SparseNumericFactorSymmetric for 1000~2000 times. Matrix: https://www.dropbox.com/s/2pyl0cpmgy1qdrh/mat.mtx.zip?dl=0 The following code calls Apple Accelerate through a wrapper from Eigen 3.4.9 (https://eigen.tuxfamily.org/dox/group__AccelerateSupport__Module.html): #include <unsupported/Eigen/SparseExtra> #include <Eigen/AccelerateSupport> #include <iostream> int main() { Eigen::SparseMatrix<double> A; Eigen::loadMarket(A, "mat.mtx"); for (int i = 0; i < 2000; ++i) { Eigen::AccelerateLLT<Eigen::SparseMatrix<double>> solver; solver.compute(A); std::cout << i << std::endl; } return 0; } The factorizations should perform smoothly for the times specified in the for-loop. But the app will hang and stop being responsive infinitely after performing the factorization for hundreds of times (sometimes ~500+ loops, or sometimes ~900+ loops). I'm using a Xcode Version 13.1 (13A1030d) on MacOS Monterey 12.5.1 (21G83), with Apple M1 Max. It seems this issue is related to multithreading in VecLib since it only happens when we leave the environment variable unset (i.e., VECLIB_MAXIMUM_THREADS > 1). Setting VECLIB_MAXIMUM_THREADS = 1 will eliminate the issue at the cost of losing performance. And this issue only happens on M1 Macs, not on Intel-based ones.
0
0
1.1k
Aug ’22
Unable to AirPlay from iOS app running on M1 Mac
Background: We recently added support for running the iOS version of our video streaming app on M1 MacBooks - as part of this we'd like to be able to AirPlay from within the M1 version of the app to external devices (tvOS, LG, Roku, etc..). AirPlay works as expected when running the iOS app on an iPhone, however, when running the iOS app on an M1 Mac, AirPlay does not work. It attempts to make a connection, but the video player goes black on the sender device and nothing appears on the receiving device. We use AVPlayer as our underlying video implementation. AVRoutePickerView is used to establish the AirPlay connections. Question: Is AirPlay supported for iOS apps running on apple silicon? Are there certain flags that need to be set to enable this? Any idea what may be causing the failed AirPlay connection? Error: This error appears immediately after attempting to AirPlay, unsure if it is related: sendMessageWithDictionary: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service named com.apple.rtcreportingd}```
0
0
1.4k
Aug ’22
(Apple Silicon) SIGBUS / KERN_PROTECTION_FAILURE
Hello! Could someone please help me make sense of this crash? It occurs only on Apple Silicon, and I can't make heads or tails of it. The code is invoking a JIT-compiled routine. The same call to the same address works dozens of times during the program's run, then crashes unexpectedly with a bus error, evidently without executing any code. According to the dump extract below, the region is readable, writable, and executable at the time of the crash. I've verified that the code in the region does not change between successful and crashing calls. What possible change in the process configuration would explain SIGBUS at an address that's apparently mapped, executable, and contains valid code that previously ran without issues? Thanks in advance for any insight! Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000280e37d38 Exception Codes: 0x0000000000000002, 0x0000000280e37d38 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 10 Bus error: 10 Terminating Process: exc handler [99567] VM Region Info: 0x280e37d38 is in 0x280dc0000-0x280e40000; bytes after start: 490808 bytes before end: 33479 REGION TYPE START - END [VSIZE] PRT/MAX SHRMOD VM_ALLOCATE 280d60000-280dc0000 [ 384K] rw-/rwx SM=ZER ---> VM_ALLOCATE 280dc0000-280e40000 [ 512K] rwx/rwx SM=ZER VM_ALLOCATE 280e40000-280ec0000 [ 512K] rw-/rwx SM=ZER
2
0
1.7k
Aug ’22
Quality of video encoding (VideoToolBox) on M1 Macs
Hi, I think that a visual quality of hardware video encoder (VideoToolBox H.264) in M1 Macs is not great. I compared a software libx264 encoder (Mac) and NVIDIA Geforce (NVENC) on Windows 10 with the same bitrate or constant quality mode producing almost identical file size. I see many visual artefacts on a video encoded with VideoToolBox H.264 (1080p 60 fps) 3300K or CQ56. It's especially noticeable on video with animated photo slideshows and blur effect. Too many artefacts. NVENC and libx264 produce much better visual results with the same file size. I tested in my app and in Handbrake Beta for M1 which supports VideoToolBox H.264 encoding. Apple engineers can contact me for more details.
5
2
11k
Aug ’22
Shutting down M1 Mac - app no longer able to extend time?
Hi all, so, in my app Transloader, when the app is terminated, I sync the Mac's "turned off" status to iCloud. This works on Intel Macs and on Apple silicon Macs when the user manually quits the app. However, on Apple silicon Macs, when the user shuts down or restarts the Mac and the app is terminated that way, the app is terminated right away (doesn't even receive the -applicationWillTerminate: call), so I'm unable to properly sync the status. This still works on Intel Macs, as far as I know. So, is there any new API to extend the Mac's shutdown a little longer to finish my sync? Currently, I use -applicationShouldTerminate:, returning NSTerminateLater, and after syncing, calling -replyToApplicationShouldTerminate:YES . Again, this works fine on Intel Macs if the user manually quits, as well as if the Intel Mac shuts down, but on Apple silicon, it only works if the user manually quits - a shutdown results in the app being terminated without even receiving a -applicationWillTerminate: call. Both NSSupportsSuddenTermination and NSSupportsAutomaticTermination are disabled in the app's Info.plist. Thank you for any insights, Matt
2
0
1.5k
Aug ’22
DualBoot possibility for Silicon Chips
Hello, Is there any progress on being able to dualboot on macs using the new silicon chips? I am considering buying a new macbook pro but the possibility to add a linux distribution is crucial for me due to my work. I do not want to have to carry two computers around. Is there progress and an update when this may be possible with the new chips? Thank you!
1
0
507
Aug ’22
Xcode and LibTorch on Apple M1 Silicon
I'm trying to learn Xcode and iOS development with swift. I'm going through the PyTorch tutorial to configure the Xcode env and I'm unable to get it working. Specifically I'm just doing the simple helloWorld project. The installation of the libraries seems to have gone fine as has the pytorch pod install command. However when I try to build, it fails with this error: ld: in /Users/user/Development/mobileTorch/ios-demo-app/HelloWorld/HelloWorld/Pods/LibTorch/install/lib/libtorch.a(empty.cpp.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/user/Development/mobileTorch/ios-demo-app/HelloWorld/HelloWorld/Pods/LibTorch/install/lib/libtorch.a' for architecture arm64 clang: error: linker command failed with exit code 1 System: 2020 Macbook Air Apple M1 silicon Steps taken: Installed libtorch 1.7 with sudo gem install ffi and then pod install Tried to build with various different iOS emulators Installing the gems both with Rosetta and natively I presume the issue lies somewhere in the apple silicon but I'm not sure what else to try.
6
2
4.3k
Aug ’22
Both ios-x86_64-simulator and ios-arm64-simulator represent two equivalent library definitions. XCFramework for iOS simulator on M1 & Intel Mac? How?
I now have an M1 Mac and an Intel Mac. I have an XCFramework that targets the iOS simulator and devices. My XCFramework works fine but I'd like to be able to run my app (which uses the XCFramework) on the iOS simulator on both my Macs (m1 &amp; intel). Now my M1 Mac complains about the x86_64 architecture when I try to run it on the simulator. So I rebuilt the XCFramework (recompiling the simulator version on the M1 Mac). I'm compiling the source code from Terminal (building OpenSSL). There is no .xcarchive here. Anyway now the app runs on the simulator on the M1 Mac but on the Intel Mac it won't build (basically the same problem in reverse). So... I made three versions of the library now (for iOS devices, iOS simulator on m1 Mac, and for the iOS simulator on Intel Macs). When I try to make an XCFramework to wrap all three static libraries I get the following error: Both "ios-x86_64-simulator" and "ios-arm64-simulator" represent two equivalent library definitions. I found another thread where the accepted answer was to lipo the x86_64 and arm simulators together, then build the xcframework. I've seen posts from Apple engineers that say using lipo is not supported (reference: https://developer.apple.com/forums/thread/709812?answerId=719667022#719667022 ) So where am I going wrong? I try to make the xcframework like so: xcodebuild -create-xcframework -library build/sim/openssl-1.1.1q/libcrypto.a -headers build/sim/openssl-1.1.1q/crypto -library build/phones/openssl-1.1.1q/libcrypto.a -headers build/phones/openssl-1.1.1q/crypto -library build/intelsim/openssl-1.1.1q/libcrypto.a -headers build/intelsim/openssl-1.1.1q/crypto -output build/Crypto.xcframework
3
1
6.9k
Aug ’22
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
Hi, I have found multiple questions on this topic but none of the proposals solves my problem so please stay with me on the description below since I am obviously missing something. I have an iOS Framework that links with multiple static libraries from a C Open Source project using "Other Linker flags" and "Library search paths". These .a files are all fat binaries including arm64 and x86_64 versions. This Framework is later used by a regular iOS app after being packed into an XCFramework (do note, when generating the XCFramework I use EXCLUDED_ARCHS="arm64" for the simulator build since a long time and I think this is also wrong). Everything works fine on device but I have never gotten the Simulator to work on my M1 Mac and now I am trying to fix that but without success, when trying to start the simulator on M1 I get this error for the first fat .a found: building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 I do not want to exclude arm64 arch for the simulator as suggested in some posts since I want to be able to run the app in arm64 mode on the Simulator. Also, when starting the simulator on my M1 (not using Rosetta) I am expecting it to run in arm64 mode so then it makes no sense that it complains that the static lib is an arm64 lib right? I have tried changing Build only active archs and other suggestions but nothing has helped. I also checked the fat binary used from the framework with otools as suggested by @eskimo in another post and it spat out this: Load command 1 cmd LC_BUILD_VERSION cmdsize 24 platform 2 minos 13.0 sdk 15.4 ntools 0 which I think is correct, PLATFORM_IOS. I assume the arm64 .a file that runs in the xCode Simulator is the same as the arm64 .a that runs on device right? Or do I have to build arm64 for the Mac platform to run the iOS simulator on M1? Very grateful for any ideas on what might be wrong.
2
0
3.2k
Jul ’22
Can you remove Rosetta 2 on Apple Silicon?
I need to test my installer on Apple Silicon, and I have previously installed Rosetta so I no longer get the prompt to install Rosetta. The Mac mini and Macbook Air M1 that were ordered came with 11.0.1 and 11.0.0 respectively. The mini didn't have Rosetta and Air is pre-installed. Short of reinstalling Big Sur on the mini M1, how can I delete Rosetta 2?
14
3
39k
Jul ’22
Need help to run unit tests of .NET library on macOS with Apple Silicon chip
Hello, I'm developing an open source .NET library to work with MIDI – DryWetMIDI. Recently the issue was reported – DllNotFoundException on Apple Silicon chips. So the multimedia API (devices, default playback) of the library is not working on macOS with Apple Silicon CPUs. The possible fix is ready and pushed to the test branch of the library repo. But I don't have a machine with macOS and Apple Silicon chip. So maybe someone can help me and would be so kind to run unit tests of the library on their machine? As I've noticed in the issue: But I should to note that complete tests run takes noticeable amount of time. Tests are logically divided into two categories: Core and Multimedia. Each category runs for about 20-25 minutes. Core tests can be run with your regular work on computer in parallel. But it's desired for Multimedia tests to be run without any user activity on a machine. It's because of the nature of those tests. Many of them checks that specific events occurred within a small amount of time (like 30 or even 15 ms), so any other activity can affect tests and they will fail. Of course I will give step-by-step instruction of how to run the tests.
0
0
509
Jul ’22
If an app bundle is copied from its original location it will not be able to launch on M1
We have not been able to launch any of the applications we build using the most recent build tools and platform. To be specific, this problem occurs with Xcode 13.4.1 or newer on macOS Monterey 12.6 (possibly earlier as well) with a Silicon processor. On a similar Intel machine, there is no issue. The symptom is as follows: If the application is built entirely in Xcode and not copied anywhere, it does launch successfully (same thing applies if it is moved into another location). But if it is copied somewhere else, its icon just bounces forever and nothing else happens. Apparently the program launcher (launchd, I suppose) is for some reason unable to launch the application, or it refuses to do so. Even so, no complaints are found in the log file for launchd. We usually build our applications using command line build tools and a specially crafted scripts for putting files into the application bundle, code signing and notarising. It is of course critical for us that we can put together and distribute our applications to machines running on a Silicon processor, so any help will be greatly appreciated. The problem is easily reproduced. Simply create an application from the macOS App template in Xcode. Then locate the app bundle somewhere beneath the folder ~/Library/Developer/, and copy it to another location on the machine. You will not be able to launch the copy of the application.
Replies
8
Boosts
0
Views
2.6k
Activity
Oct ’22
C code running significantly slower on M1 mac than old i7
Hey guys, trying to find some help with this as I can't find anything anywhere. I am following BlueFever Software's online videos about making a chess engine in C. I've gotten to the point where we're performing what's called Perft Testing where the MoveGenerator is tested for issues. When running those tests, I noticed that the time it takes my M1 mac to perform said test is multiple times slower than even the video(which was made in 2013 on a Dual-core). I tried running the exact same program on my i7 laptop(which I bought in 2016), and it's at least 50 times faster. Running Activity Monitor, I can see that the program is using 100% of the available CPU and like 400GB of virtual RAM. A link to the exact code can be found here: https://github.com/JensDevWoW/Vice Not sure what makes this run so badly on the M1 Mac, hoping someone might be able to provide some insight: INFO: Main computer: M1 Chip, 8GB Memory, macOS Monterey 12.4, compiled using Apple Clang with X Code Laptop: i7, 16GB RAM, Windows 10, compiled using gcc on Visual Studio 2019
Replies
0
Boosts
0
Views
710
Activity
Sep ’22
Project doesn't archive, complains about architecture
I have a SwiftUI project, iOS16, it builds fine if I choose a simulator/device, but when I choose Any iOS Device (arm64) and hit Archive, it fails with error: error build: Entry point (_main) undefined. for architecture arm64 I'm using an M1 Mac Studio to build it. I have the following in my main: @main struct MyAppNameApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate ... } class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Sets cache for Images downloader SDWebImageSwiftUI // ... return true } } Under Architectures I have the following: Should I select for release Yes as well? Why is it failing? What setting do I have to look into? Thanks
Replies
2
Boosts
0
Views
1.4k
Activity
Sep ’22
Mac App Store url problem on Mac M1
Hello, I have an iOS application which has a "rate us" button. This button redirects to "Write review" section on the app's App Store. It is working great on both iPhone and iPad devices. The problem is on MacBook M1 - it is working, but once the App Store app for review is opened, my iOS app crashes :( UIApplication.shared.open(URL(string: "itms-apps://itunes.apple.com/us/app/app-name/id*****?action=write-review")!) Any ideas on how it can be fixed? Thanks!
Replies
11
Boosts
1
Views
3.8k
Activity
Sep ’22
Reset permissions for iOS apps installed on Apple Silicon Mac
UI flows can be built around requesting permissions for, for example, camera or microphone access in iOS apps. With Xcode 14, it's super easy to run an app on an Apple Silicon Mac with the device "My Mac (Designed for iPhone)". However, how do you reset camera permissions to new install state for an iOS app installed and run that way on Mac? Naturally, removing the app from the Products folder does not remove its row in Settings -&gt; Security and Privacy -&gt; Camera on MacOS and disabling camera access via that row sets AVCaptureDevice.authorizationStatus to denied and not notDetermined even with a fresh install.
Replies
2
Boosts
0
Views
1.9k
Activity
Sep ’22
Cannot boot to recovery in M2. Feedback Filed.
MacBook Pro 13.3" - Y4QVXL9FGW M2 8-core 24GB Unified memory 1T Solid Disk MacOS 12.5.1 (21G83) The screen flash pink and restarted again. No kernel crash log or warning anyhow.
Replies
0
Boosts
0
Views
1.5k
Activity
Sep ’22
Random hangs on M1 in Apple Accelerate when performing sparse Cholesky factorization
Hello, I'm trying to use Accelerate's sparse Cholesky solver but met an issue on M1. Is anyone aware of this issue or similar ones? The sparse factorization class _SparseNumericFactorSymmetric in Apple Accelerate will hang randomly for some large symmetric positive definite matrices with a specific sparsity pattern when created for Cholesky factorization. This issue happens in probability about 1/1000. It can be reproduced through following steps Read and load the attached sparse matrix (in MatrixMarket format). In a for-loop, repeatedly factorize the same matrix through _SparseNumericFactorSymmetric for 1000~2000 times. Matrix: https://www.dropbox.com/s/2pyl0cpmgy1qdrh/mat.mtx.zip?dl=0 The following code calls Apple Accelerate through a wrapper from Eigen 3.4.9 (https://eigen.tuxfamily.org/dox/group__AccelerateSupport__Module.html): #include <unsupported/Eigen/SparseExtra> #include <Eigen/AccelerateSupport> #include <iostream> int main() { Eigen::SparseMatrix<double> A; Eigen::loadMarket(A, "mat.mtx"); for (int i = 0; i < 2000; ++i) { Eigen::AccelerateLLT<Eigen::SparseMatrix<double>> solver; solver.compute(A); std::cout << i << std::endl; } return 0; } The factorizations should perform smoothly for the times specified in the for-loop. But the app will hang and stop being responsive infinitely after performing the factorization for hundreds of times (sometimes ~500+ loops, or sometimes ~900+ loops). I'm using a Xcode Version 13.1 (13A1030d) on MacOS Monterey 12.5.1 (21G83), with Apple M1 Max. It seems this issue is related to multithreading in VecLib since it only happens when we leave the environment variable unset (i.e., VECLIB_MAXIMUM_THREADS > 1). Setting VECLIB_MAXIMUM_THREADS = 1 will eliminate the issue at the cost of losing performance. And this issue only happens on M1 Macs, not on Intel-based ones.
Replies
0
Boosts
0
Views
1.1k
Activity
Aug ’22
Unable to AirPlay from iOS app running on M1 Mac
Background: We recently added support for running the iOS version of our video streaming app on M1 MacBooks - as part of this we'd like to be able to AirPlay from within the M1 version of the app to external devices (tvOS, LG, Roku, etc..). AirPlay works as expected when running the iOS app on an iPhone, however, when running the iOS app on an M1 Mac, AirPlay does not work. It attempts to make a connection, but the video player goes black on the sender device and nothing appears on the receiving device. We use AVPlayer as our underlying video implementation. AVRoutePickerView is used to establish the AirPlay connections. Question: Is AirPlay supported for iOS apps running on apple silicon? Are there certain flags that need to be set to enable this? Any idea what may be causing the failed AirPlay connection? Error: This error appears immediately after attempting to AirPlay, unsure if it is related: sendMessageWithDictionary: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service named com.apple.rtcreportingd}```
Replies
0
Boosts
0
Views
1.4k
Activity
Aug ’22
(Apple Silicon) SIGBUS / KERN_PROTECTION_FAILURE
Hello! Could someone please help me make sense of this crash? It occurs only on Apple Silicon, and I can't make heads or tails of it. The code is invoking a JIT-compiled routine. The same call to the same address works dozens of times during the program's run, then crashes unexpectedly with a bus error, evidently without executing any code. According to the dump extract below, the region is readable, writable, and executable at the time of the crash. I've verified that the code in the region does not change between successful and crashing calls. What possible change in the process configuration would explain SIGBUS at an address that's apparently mapped, executable, and contains valid code that previously ran without issues? Thanks in advance for any insight! Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000280e37d38 Exception Codes: 0x0000000000000002, 0x0000000280e37d38 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 10 Bus error: 10 Terminating Process: exc handler [99567] VM Region Info: 0x280e37d38 is in 0x280dc0000-0x280e40000; bytes after start: 490808 bytes before end: 33479 REGION TYPE START - END [VSIZE] PRT/MAX SHRMOD VM_ALLOCATE 280d60000-280dc0000 [ 384K] rw-/rwx SM=ZER ---> VM_ALLOCATE 280dc0000-280e40000 [ 512K] rwx/rwx SM=ZER VM_ALLOCATE 280e40000-280ec0000 [ 512K] rw-/rwx SM=ZER
Replies
2
Boosts
0
Views
1.7k
Activity
Aug ’22
* device name* cannot run executables for arm64.
When I try to run the application in the simulator, I get an error message. I'm using xcode 13.4.1 (13F100) on M1 MacBook Pro. How can this be resolved?
Replies
1
Boosts
0
Views
816
Activity
Aug ’22
Quality of video encoding (VideoToolBox) on M1 Macs
Hi, I think that a visual quality of hardware video encoder (VideoToolBox H.264) in M1 Macs is not great. I compared a software libx264 encoder (Mac) and NVIDIA Geforce (NVENC) on Windows 10 with the same bitrate or constant quality mode producing almost identical file size. I see many visual artefacts on a video encoded with VideoToolBox H.264 (1080p 60 fps) 3300K or CQ56. It's especially noticeable on video with animated photo slideshows and blur effect. Too many artefacts. NVENC and libx264 produce much better visual results with the same file size. I tested in my app and in Handbrake Beta for M1 which supports VideoToolBox H.264 encoding. Apple engineers can contact me for more details.
Replies
5
Boosts
2
Views
11k
Activity
Aug ’22
Shutting down M1 Mac - app no longer able to extend time?
Hi all, so, in my app Transloader, when the app is terminated, I sync the Mac's "turned off" status to iCloud. This works on Intel Macs and on Apple silicon Macs when the user manually quits the app. However, on Apple silicon Macs, when the user shuts down or restarts the Mac and the app is terminated that way, the app is terminated right away (doesn't even receive the -applicationWillTerminate: call), so I'm unable to properly sync the status. This still works on Intel Macs, as far as I know. So, is there any new API to extend the Mac's shutdown a little longer to finish my sync? Currently, I use -applicationShouldTerminate:, returning NSTerminateLater, and after syncing, calling -replyToApplicationShouldTerminate:YES . Again, this works fine on Intel Macs if the user manually quits, as well as if the Intel Mac shuts down, but on Apple silicon, it only works if the user manually quits - a shutdown results in the app being terminated without even receiving a -applicationWillTerminate: call. Both NSSupportsSuddenTermination and NSSupportsAutomaticTermination are disabled in the app's Info.plist. Thank you for any insights, Matt
Replies
2
Boosts
0
Views
1.5k
Activity
Aug ’22
DualBoot possibility for Silicon Chips
Hello, Is there any progress on being able to dualboot on macs using the new silicon chips? I am considering buying a new macbook pro but the possibility to add a linux distribution is crucial for me due to my work. I do not want to have to carry two computers around. Is there progress and an update when this may be possible with the new chips? Thank you!
Replies
1
Boosts
0
Views
507
Activity
Aug ’22
Xcode and LibTorch on Apple M1 Silicon
I'm trying to learn Xcode and iOS development with swift. I'm going through the PyTorch tutorial to configure the Xcode env and I'm unable to get it working. Specifically I'm just doing the simple helloWorld project. The installation of the libraries seems to have gone fine as has the pytorch pod install command. However when I try to build, it fails with this error: ld: in /Users/user/Development/mobileTorch/ios-demo-app/HelloWorld/HelloWorld/Pods/LibTorch/install/lib/libtorch.a(empty.cpp.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/user/Development/mobileTorch/ios-demo-app/HelloWorld/HelloWorld/Pods/LibTorch/install/lib/libtorch.a' for architecture arm64 clang: error: linker command failed with exit code 1 System: 2020 Macbook Air Apple M1 silicon Steps taken: Installed libtorch 1.7 with sudo gem install ffi and then pod install Tried to build with various different iOS emulators Installing the gems both with Rosetta and natively I presume the issue lies somewhere in the apple silicon but I'm not sure what else to try.
Replies
6
Boosts
2
Views
4.3k
Activity
Aug ’22
Find Clock Speed on M1 Mac
Attempting to find nominal CPU clock frequency. Previously have been finding this using sysctlbyname() with name="hw.cpufrequency" or with sysctl() with name[0]=CTLHW and name[1]=HWCPU_FREQ. I also notice that processor speed no longer shows in 'About this Mac'. Anyone know I programmatically find this value on an M1 machine?
Replies
3
Boosts
1
Views
7.5k
Activity
Aug ’22
Both ios-x86_64-simulator and ios-arm64-simulator represent two equivalent library definitions. XCFramework for iOS simulator on M1 & Intel Mac? How?
I now have an M1 Mac and an Intel Mac. I have an XCFramework that targets the iOS simulator and devices. My XCFramework works fine but I'd like to be able to run my app (which uses the XCFramework) on the iOS simulator on both my Macs (m1 &amp; intel). Now my M1 Mac complains about the x86_64 architecture when I try to run it on the simulator. So I rebuilt the XCFramework (recompiling the simulator version on the M1 Mac). I'm compiling the source code from Terminal (building OpenSSL). There is no .xcarchive here. Anyway now the app runs on the simulator on the M1 Mac but on the Intel Mac it won't build (basically the same problem in reverse). So... I made three versions of the library now (for iOS devices, iOS simulator on m1 Mac, and for the iOS simulator on Intel Macs). When I try to make an XCFramework to wrap all three static libraries I get the following error: Both "ios-x86_64-simulator" and "ios-arm64-simulator" represent two equivalent library definitions. I found another thread where the accepted answer was to lipo the x86_64 and arm simulators together, then build the xcframework. I've seen posts from Apple engineers that say using lipo is not supported (reference: https://developer.apple.com/forums/thread/709812?answerId=719667022#719667022 ) So where am I going wrong? I try to make the xcframework like so: xcodebuild -create-xcframework -library build/sim/openssl-1.1.1q/libcrypto.a -headers build/sim/openssl-1.1.1q/crypto -library build/phones/openssl-1.1.1q/libcrypto.a -headers build/phones/openssl-1.1.1q/crypto -library build/intelsim/openssl-1.1.1q/libcrypto.a -headers build/intelsim/openssl-1.1.1q/crypto -output build/Crypto.xcframework
Replies
3
Boosts
1
Views
6.9k
Activity
Aug ’22
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
Hi, I have found multiple questions on this topic but none of the proposals solves my problem so please stay with me on the description below since I am obviously missing something. I have an iOS Framework that links with multiple static libraries from a C Open Source project using "Other Linker flags" and "Library search paths". These .a files are all fat binaries including arm64 and x86_64 versions. This Framework is later used by a regular iOS app after being packed into an XCFramework (do note, when generating the XCFramework I use EXCLUDED_ARCHS="arm64" for the simulator build since a long time and I think this is also wrong). Everything works fine on device but I have never gotten the Simulator to work on my M1 Mac and now I am trying to fix that but without success, when trying to start the simulator on M1 I get this error for the first fat .a found: building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 I do not want to exclude arm64 arch for the simulator as suggested in some posts since I want to be able to run the app in arm64 mode on the Simulator. Also, when starting the simulator on my M1 (not using Rosetta) I am expecting it to run in arm64 mode so then it makes no sense that it complains that the static lib is an arm64 lib right? I have tried changing Build only active archs and other suggestions but nothing has helped. I also checked the fat binary used from the framework with otools as suggested by @eskimo in another post and it spat out this: Load command 1 cmd LC_BUILD_VERSION cmdsize 24 platform 2 minos 13.0 sdk 15.4 ntools 0 which I think is correct, PLATFORM_IOS. I assume the arm64 .a file that runs in the xCode Simulator is the same as the arm64 .a that runs on device right? Or do I have to build arm64 for the Mac platform to run the iOS simulator on M1? Very grateful for any ideas on what might be wrong.
Replies
2
Boosts
0
Views
3.2k
Activity
Jul ’22
Can you remove Rosetta 2 on Apple Silicon?
I need to test my installer on Apple Silicon, and I have previously installed Rosetta so I no longer get the prompt to install Rosetta. The Mac mini and Macbook Air M1 that were ordered came with 11.0.1 and 11.0.0 respectively. The mini didn't have Rosetta and Air is pre-installed. Short of reinstalling Big Sur on the mini M1, how can I delete Rosetta 2?
Replies
14
Boosts
3
Views
39k
Activity
Jul ’22
Need help to run unit tests of .NET library on macOS with Apple Silicon chip
Hello, I'm developing an open source .NET library to work with MIDI – DryWetMIDI. Recently the issue was reported – DllNotFoundException on Apple Silicon chips. So the multimedia API (devices, default playback) of the library is not working on macOS with Apple Silicon CPUs. The possible fix is ready and pushed to the test branch of the library repo. But I don't have a machine with macOS and Apple Silicon chip. So maybe someone can help me and would be so kind to run unit tests of the library on their machine? As I've noticed in the issue: But I should to note that complete tests run takes noticeable amount of time. Tests are logically divided into two categories: Core and Multimedia. Each category runs for about 20-25 minutes. Core tests can be run with your regular work on computer in parallel. But it's desired for Multimedia tests to be run without any user activity on a machine. It's because of the nature of those tests. Many of them checks that specific events occurred within a small amount of time (like 30 or even 15 ms), so any other activity can affect tests and they will fail. Of course I will give step-by-step instruction of how to run the tests.
Replies
0
Boosts
0
Views
509
Activity
Jul ’22
Xcode Simulator m1 - can't pick images
Hi, can anybody confirm that there are a problem with the image picker on Xcode 12.4 / Sim 12.4 on the new apple silicon MacBook m1? Best, Dominik
Replies
28
Boosts
2
Views
20k
Activity
Jul ’22