# Help to select a Raspberry Pi for embedding Julia application

**URL:** <https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848>\
**Category:** General Usage\
**Created:** [May 20, 2020, 5:58pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848 "2020-05-20T17:58:46Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 21, 2020, 8:59pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/21 "2020-05-21T20:59:22Z")

</div>

Hum, thanks for that info! It was very important to me. Maybe I will need to use a bespoke ODE solver to avoid using DiffEq packages which are indeed very big.

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [May 21, 2020, 10:34pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/22 "2020-05-21T22:34:20Z")

</div>

I have since noticed that there is a package [GitHub - SciML/OrdinaryDiffEq.jl: High performance differential equation solvers for ordinary differential equations, including neural ordinary differential equations (neural ODEs) and scientific machine learning (SciML)](https://github.com/SciML/OrdinaryDiffEq.jl), which is “a component package in the DifferentialEquations ecosystem. It holds the ordinary differential equation solvers and utilities”, and “can be used independently of DifferentialEquations.jl”. @ChrisRackauckas can probably comment on whether using it will reduce the precompilation memory usage.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 21, 2020, 10:51pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/23 "2020-05-21T22:51:00Z")

</div>

Yup that’s the way to do it. Indeed, when you think of DifferentiaEquations.jl on ODEs, it’s actually just calling into OrdinaryDiffEq. If you don’t need events you can even use [SimpleDiffEq.jl](https://github.com/JuliaDiffEq/SimpleDiffEq.jl).

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 21, 2020, 10:57pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/24 "2020-05-21T22:57:35Z")

</div>

This is amazing! Precisely what I needed. The solver inside do not need events. Do you plan to support simple algorithms like a fixed-step RK4 inside this package? (If so, I can submit a PR to add this)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 21, 2020, 11:28pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/25 "2020-05-21T23:28:35Z")

</div>

Yeah, a `SimpleRK4` would be good to have here.

---

<div class="post-metadata">

**Author:** ![viralbshah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viralbshah/32/54_2.png) [@viralbshah](https://discourse.julialang.org/u/viralbshah)\
**Post date:** [May 21, 2020, 11:54pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/26 "2020-05-21T23:54:55Z")

</div>

> [@Ronis\_BR](#):
>
> I was looking at the specs. and it seems that the Pi 4B will be overkill (the test device must be battery-powered, and it is very hungry). So, the Pi Zero W should be enough.

Pi Zero is probably a bit low on the RAM for a stock Julia build.

If you can build a custom system image - removing all the things that are not necessary. Perhaps even PackageCompile your entire application into a minimal system image.

I think 1.4.1 would be much better than 1.0.x.

-viral

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 22, 2020, 12:00am UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/27 "2020-05-22T00:00:56Z")

</div>

Thanks for the suggestion! I think there will be no problem to build a custom system image with PackageCompiler removing all the unnecessary packages from stdlib. However, now that you mention, I think 512MB of RAM will really not be enough to build Julia and/or build the sysimg. AFAIK, there is no way to “cross-compile” the sysimg right?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 22, 2020, 7:53am UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/28 "2020-05-22T07:53:18Z")

</div>

I might be completely off base here but reading the 512MB constraint just thought I’d mention that people (including myself) have successfully deployed Julia apps on Heroku’s free tier, which has only [512MB RAM](https://www.heroku.com/dynos) - as an example Matt Bauman’s Covid dashboard [here](https://github.com/mbauman/CovidCountyDash.jl)

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [May 22, 2020, 12:38pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/29 "2020-05-22T12:38:46Z")

</div>

I think it depends on exactly which packages you use and how much RAM each needs for precompilation. I got hung up specifically on DifferentialEquations (hadn’t finished in something like an hour when I gave up) but other stuff worked fine. Don’t remember if I tried Plots. But in any case my experiment was at least 6 months ago and I didn’t know to use a smaller version of the DiffEq packages.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 22, 2020, 1:16pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/30 "2020-05-22T13:16:18Z")

</div>

Can anyone who has a SBC with 512 MB of RAM and already has Julia installed, please, add SatelliteToolbox.jl and see if it can pre-compile?

P.S.: If I install Raspberry in a VM with 512 MB of RAM, will I have a representative setup to test?

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [May 22, 2020, 1:57pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/31 "2020-05-22T13:57:43Z")

</div>

> I also can use PackageCompiler to create an executable, but I want to avoid that. My goal is to have the very same code I use in the simulator

It’s is some sense the same (and some not), but even if not, I’m confused why you couldn’t use that same compiled code in the simulator? If however, it runs on say x86 in the simulator, then that would be a much bigger difference. Generated ARM code should be equivalent (not exact same timings), and if not, a compiler/julia bug, and those can’t be ruled out.

Note, when I say compiler/julia bug, that also applies without PackageCompiler.jl, as Julia is always compiled, just not with a separate compile step. For greater difference and speed you could use `-O3` (while my understanding is there’s not much difference to the default `-O2` in later Julia releases). Using higher levels, 2 or 3, makes a lot more sense with PackageCompiler, while without `-O1` makes a lot of sense (for faster compile/startup of code), and at least on non-embedded.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 22, 2020, 2:05pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/32 "2020-05-22T14:05:06Z")

</div>

> [@Palli](#):
>
> It’s is some sense the same (and some not), but even if not, I’m confused why you couldn’t use that same compiled code in the simulator?

You mean Julia compiled code by PackageCompiler? AFAIK, a system image created by PackageCompiler depends on the architecture. Thus, I think I cannot build a system image in x86 and use it in ARM.

---

<div class="post-metadata">

**Author:** ![GregR](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@GregR](https://discourse.julialang.org/u/GregR)\
**Post date:** [May 22, 2020, 3:18pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/33 "2020-05-22T15:18:11Z")

</div>

It is not looking good on the Pi Zero. It has been pre-compiling for 12 minutes and has gone into swap.  
I will give it a couple of more minutes before killing the process. ☹

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 22, 2020, 3:36pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/34 "2020-05-22T15:36:13Z")

</div>

Thank you very much!!

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 22, 2020, 3:52pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/35 "2020-05-22T15:52:40Z")

</div>

> [@GregR](#):
>
> I have been experimenting with Julia on the RPi 4B. You don’t have to use a fan, however, there are passive heatsinking “cases” which do a very good job. The heatsink will get very warm!

Did you check how much the CPU is throttling with a passive heatsing? It will continue working even if it heats up, just with somewhat diminished performance. I get this on the 4B with a nontrivial (but not nearly full) load after a minute or two with the passive heatsink.

I realize that the current topic is converging to using one of the earlier/less beefy models, but after having tried it I am wondering what niche the 4B fills. The 3B(+) is a decent mini-computer, while being fanless and totally silent. The Zero feels like magic for $5, you can do wonderful things with it. But when you start thinking about cooling and airflow and all that, you might as well just get a PC, possibly with passive cooling.

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [May 22, 2020, 4:11pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/36 "2020-05-22T16:11:52Z")

</div>

Just FYI, on the topic of RPI4 temps: I have mine using the PoE Hat which comes with a built-in fan. Even under load it doesn’t go much above 72-73C. I got it to spike to 78C with a cpuburn stress test.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 22, 2020, 4:28pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/37 "2020-05-22T16:28:57Z")

</div>

Hum, does the Pi 3 is that much better in terms of throttling ? Given the specs, it is more than enough for my application. I mean, without considering the precompilation / Julia build.

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [May 22, 2020, 5:07pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/38 "2020-05-22T17:07:11Z")

</div>

I dug my 3B+ out of the cabinet and just launched `@time using SimpleDiffEq`.  
Finished in 341 seconds. Will try OrdinaryDiffEq next.

EDIT: `add OrdinaryDiffEq` failed with an error about building VectorizationBase, failure to precompile CpuId, so can’t time that right now.

This is with Julia v1.2.0 (what happened to be on my Raspberry Pi from when I last played with it).

I might try to update the Julia installation and see if I can get past that error but it may be a day or two before I get to it.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 22, 2020, 5:20pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/39 "2020-05-22T17:20:38Z")

</div>

> [@klaff](#):
>
> EDIT: `add OrdinaryDiffEq` failed with an error about building VectorizationBase, failure to precompile CpuId, so can’t time that right now.

Could we get information on this for @Elrod and @YingboMa ? Just an rpi thing?

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 22, 2020, 5:21pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/40 "2020-05-22T17:21:43Z")

</div>

I think I can use SimpleDiffEq and just pick some required functions in SatelliteToolbox. Perhaps, I will need to finally start splitting SatelliteToolbox into smaller packages.

Thanks for the help!

[Previous page](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848.md?page=1)

[Next page](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848.md?page=3)
