M1 Running Julia on Asahi Linux - installation

Julia runs on M1 Mac on Asahi Linux

Asahi Linux now works on M1 and has most drivers up and running.

I have changed this post many times as I have failed and learned

I am installing what I call “Versions of the language Julia”

Don’t use julia or julia-bin from the AUR using yay they are not ARM compatible.

Don’t use the M1 ARM from the Julia website because it’s a DMG designed for Macs. It works on the M1 native Mac OS obviously but the two dual booted OSes eat different file types.

I am trying the Linux ARM from the official Julia repo - maybe should have done that first

Sorry for anyone watching this change again and again it’s a fast moving topic

And I am incompetent

Thank you @simeonschaub

2 Likes

Don’t use the standard Julia from the AUR, it ships with broken dependencies. There’s a julia-bin, which ships the official Julia binaries, if you want a version manager there’s even a juliaup recipe.

2 Likes

So helpful

Changed the original post- speaks for itself

Jill.sh is also a good option: https://github.com/abelsiqueira/jill

The ARM worked

So how is the experience so far in general? Everything works? Drivers? Arch Binaries? Julia run fast?

It is really fast. I am really happy. Asahi are pretty up-front that it’s all alpha.

It’s pretty cool. It uses dual-booted drivers which are handled by the parallel MacOS which remains installed.

Compiles fast. I installed Plots and did some random stuff and it was fast even on the first run.

Everything that I need works but lots of hardware doesn’t yet. GPU doesn’t for example. But, like wifi… yeah.

It’s a nice wee community as well. The lead, Marcan, is really approachable. Every one is excited. Feels like start of something.

1 Like

I didn’t use AUR in the end I used the Linux ARM tar.gz from the Julia webpage sorted my path rebooted and it works.

Whenever you were free and had the energy, please do some simple performance comparisons with MacOS, this is exciting.

1 Like

I might do that and compare with some x86_64 Linux as well

What would be the best topic for that do you think @AMJ

1 Like

Great, thanks.

From experience speaking, Im not that sophisticated of a user of Julia, most of my use cases are parsing json and simple decision trees. Im very interested in the single thread performance and package compilation time in general but you benchmark whatever you are doing day to day with Julia.

I did a quick test using SystemBenchmark.jl: Asahi Linux vs macOS

3 Likes

So what’s the verdict for a jobbing data scientist - I am on mobile I can’t really grasp the whole .txt?

Let’s remember Asahi doesn’t pretend to be optimised for anything yet as an alpha…

Sharing the comparison table also here for reference:

julia> compare(macos, linux)
29×6 DataFrame
 Row │ cat          testname         units    ref_res                           test_res                           factor    
     │ String       String           String?  Any                               Any                                Any       
─────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ info         SysBenchVer      missing  0.4.0-dev                         0.4.1                              Not Equal
   2 │ info         JuliaVer         missing  1.8.0-DEV.107                     1.9.0-DEV.247                      Not Equal
   3 │ info         OS               missing  macOS (arm64-apple-darwin20.3.0)  Linux (aarch64-unknown-linux-gnu)  Not Equal
   4 │ info         CPU              missing  Apple M1                          8 × unknown                        Not Equal
   5 │ info         WORD_SIZE        missing  64                                64                                 Equal
   6 │ info         LIBM             missing  libopenlibm                       libopenlibm                        Equal
   7 │ info         LLVM             missing  libLLVM-12.0.0 (ORCJIT, cyclone)  libLLVM-13.0.1 (ORCJIT, apple-m1)  Not Equal
   8 │ info         GPU              missing  missing                           missing                            Not Equal
   9 │ cpu          FloatMul         ms       9.58e-7                           2.375e-6                           2.47912
  10 │ cpu          FusedMulAdd      ms       9.58e-7                           2.375e-6                           2.47912
  11 │ cpu          FloatSin         ms       3.125e-6                          5.042e-6                           1.61344
  12 │ cpu          VecMulBroad      ms       2.4238716148445335e-5             2.5435742971887548e-5              1.04938
  13 │ cpu          CPUMatMul        ms       0.036708                          0.041749                           1.13733
  14 │ cpu          MatMulBroad      ms       0.0015                            0.0015540999999999999              1.03607
  15 │ cpu          3DMulBroad       ms       0.0010986687116564418             0.0008053358778625955              0.733011
  16 │ cpu          peakflops        flops    1.3377441768769365e11             1.0614193490591101e11              0.79344
  17 │ cpu          FFMPEGH264Write  ms       239.915708                        590.738945                         2.46228
  18 │ mem          DeepCopy         ms       0.0001078838174273859             0.00014706105263157895             1.36314
  19 │ mem          Bandwidth10kB    MiB/s    79386.79169776141                 75898.86461543928                  0.956064
  20 │ mem          Bandwidth100kB   MiB/s    79751.99167137063                 48085.22746968436                  0.602935
  21 │ mem          Bandwidth1MB     MiB/s    45869.57416219758                 38082.99322762759                  0.830245
  22 │ mem          Bandwidth10MB    MiB/s    33070.63082466406                 31526.632123394204                 0.953312
  23 │ mem          Bandwidth100MB   MiB/s    28128.874133576668                27164.814178103377                 0.965727
  24 │ diskio       DiskWrite1KB     ms       0.040666                          0.016208                           0.398564
  25 │ diskio       DiskWrite1MB     ms       0.3977085                         0.317458                           0.798218
  26 │ diskio       DiskRead1KB      ms       0.008466600000000001              0.0028378888888888885              0.335186
  27 │ diskio       DiskRead1MB      ms       0.472666                          0.238375                           0.50432
  28 │ loading      JuliaLoad        ms       149.204                           77.198681                          0.517404
  29 │ compilation  compilecache     ms       217.986708                        137.57717                          0.631126

CPU benchmarks are for some reasons better on macOS than on Linux, which is quite surprising also because it appears Julia is detecting the CPU features correctly, compute performance shouldn’t in principle depend that much on the operating system. Also memory bandwidth is slightly better on macOS, but closer to Linux compared to the CPU benchmarks. Disk I/O and compilation latency instead favour Linux, but this is probably due to the fact Julia seems to suffer in this area on macOS in general, so this isn’t unexpected.

Overall Julia works pretty well on Asahi Linux, I haven’t played much but I didn’t encounter problems. The operating system instead is pretty unstable (but this is a first alpha version, so it’s ok), brightness control doesn’t work: it’s either 100% or black screen, so just don’t touch it :sweat_smile:

2 Likes

It is indeed very impressive what they have done with the Asahi Linux and reverse engineering. A little off topic, EU is now forcing companies to open up their ecosystem, sooner or later we will gonna get Julia on iPad too I guess.