Skip to content

Commit ff9194a

Browse files
lawikfhunleth
authored andcommitted
Add EXLA to enable use of at least CPU-based ML
1 parent 798c876 commit ff9194a

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

config/rpi4.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ config :vintage_net,
1010
]
1111

1212
config :delux, indicators: %{default: %{green: "ACT"}}
13+
14+
config :nx, default_backend: EXLA.Backend

config/rpi5.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ config :delux, indicators: %{default: %{green: "ACT"}}
1414
# The RPi5 doesn't support WPA3 yet, but it also doesn't fail with the generic
1515
# configuration. This will enable WPA3 support when it's available.
1616
config :vintage_net_wifi, :quick_configure, &VintageNetWiFi.Cookbook.generic/2
17+
18+
config :nx, default_backend: EXLA.Backend

mix.exs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ defmodule NervesLivebook.MixProject do
1111

1212
# See the BlueHeron repository for the boards that it supports.
1313
@ble_targets [:rpi0, :rpi3, :rpi3a]
14+
@xla_targets [:rpi4, :rpi5]
1415

1516
# Instruct the compiler to create deterministic builds to minimize
1617
# differences between firmware versions. This helps delta firmware update
1718
# compression.
1819
System.put_env("ERL_COMPILER_OPTIONS", "deterministic")
1920

21+
if Mix.target() in @xla_targets do
22+
System.put_env("XLA_TARGET_PLATFORM", "aarch64-linux-gnu")
23+
end
24+
2025
def project do
2126
[
2227
app: @app,
@@ -110,6 +115,9 @@ defmodule NervesLivebook.MixProject do
110115
{:vega_lite, "~> 0.1"},
111116
{:vintage_net_wifi, "~> 0.12.5", targets: @all_targets},
112117
{:vintage_net_qmi, "~> 0.4.1", targets: @all_targets},
118+
{:axon, "~> 0.7", targets: @xla_targets},
119+
{:bumblebee, "~> 0.6", targets: @xla_targets},
120+
{:exla, "~> 0.9", targets: @xla_targets},
113121

114122
# Nerves system dependencies
115123
{:nerves_system_rpi, "~> 1.28", runtime: false, targets: :rpi},

0 commit comments

Comments
 (0)