Julia unresponsive (Apple Silicon issue?)

I have a recurring problem where a long-running process hangs after some time. Screen updating then stops and Ctrl-C or Ctrl-D no longer interrupt the code. I have to restart iterm to stop execution.

This happens after several minutes to about half and hour while running an NLopt optimization (but the problem may not be related to NLopt). The problem arose after I switched to an M1-Pro mac (but again may not be related to Apple Silicon).

Since no error information is generated, I am unsure how to diagnose the problem.

Before I go down the rabbit hole of trying to isolate causes (multi-threading, Apple Silicon, NLopt, …), I thought I should ask for advice.

Julia Version 1.8.1
Commit afb6c60d69a (2022-09-06 15:09 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.4.0)
  CPU: 8 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, westmere)
  Threads: 8 on 8 virtual cores
Environment:
  JULIA_NUM_THREADS = 8
  JULIA_PKG_DEVDIR = /Users/lutz/Documents/julia
  JULIA_EDITOR = /usr/local/bin/code

Could you try using the native arm build instead of rosetta? Rosetta is known to have to issues with deadlocks and whatnot.

I will try the arm version and report back.

NB: I installed my updates with jill.py which ended up installing the Rosetta version even when I requested ARM (could not verify the ARM files). I thought I was already using the ARM version.

I’d also recommend trying the ARM version. I had many problems with the Rosetta one before but the latest ARM releases work fine so far (MacBook M1, Julia 1.8.1).

Btw. I highly recommend juliaup to manage Julia installations. I hesitated for year(s) before switching because I thought I am happy with my environmental-modules setup but juliaup is really awesome :wink:

So far so good with the arm version.

I’m hesitating about juliaup because of the disclaimer “Note that the Mac and Linux version are considered prerelease, have known bugs and might often break.”

I don’t know if that’s maybe an old statement. I am using it for a couple of months now and I never ever had any issues with it. Once you understand what a channel is, everthing is smooth :laughing:

I’d however recommend to install it via the official install script and not homebrew, since the homebrew keg is not updated often enough, which means you might miss new releases here and there.

I’ll give it a try - thanks.