elixir-nx / xla

Pre-compiled XLA extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

windows error: (MatchError) no match of right hand side value: {"x86_64", "windows"}

dkuku opened this issue · comments

I just installed the windows package of livebook and added the smartcells as dependencies:

Mix.install(
  [
    {:kino_bumblebee, "~> 0.1.0"},
    {:exla, "~> 0.4.1"},
    {:kino_slack, "~> 0.1.0"},
    {:kino_db, "~> 0.2.1"},
    {:kino_maplibre, "~> 0.1.7"},
    {:kino_vega_lite, "~> 0.1.7"}
  ],
  config: [nx: [default_backend: EXLA.Backend]]
)

but this ends up with an error:

==> exla
could not compile dependency :exla, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile exla", update it with "mix deps.update exla" or clean it with "mix deps.clean exla"

and a stack trace:

** (MatchError) no match of right hand side value: {"x86_64", "windows"}
    (xla 0.4.3) lib/xla.ex:111: XLA.target/0
    (xla 0.4.3) lib/xla.ex:107: XLA.archive_filename_with_target/0
    (xla 0.4.3) lib/xla.ex:145: XLA.archive_path_for_matching_download/0
    (xla 0.4.3) lib/xla.ex:32: XLA.archive_path!/0
    c:/Users/kuku/AppData/Local/mix/Cache/installs/elixir-1.14.2-erts-13.0.4/ce1c2ae539f8f08b98f16fd0261b5372/deps/exla/mix.exs:105: EXLA.MixProject.compile/1
    (mix 1.14.2) lib/mix/task.ex:492: Mix.Task.run_alias/6
    (mix 1.14.2) lib/mix/tasks/compile.all.ex:92: Mix.Tasks.Compile.All.run_compiler/2
    #cell:setup:1: (file)

I think the line:
129 ["win32"] -> {"x86_64", "windows"} need to return {"x86_64", "windows", ""}

Does it fail even if you set XLA_BUILD=true?

This is not trivial under windows :)
I set it globally in windows and I can read it in terminal but in livebook it returns nil.
I ended up with setting it before mix install - not sure if it is the way to go but it seems to work.

System.put_env("XLA_BUILD", "true")
Mix.install(
  [
    {:kino_bumblebee, "~> 0.1.0"},
    {:exla, "~> 0.4.1"}
  ],
  config: [nx: [default_backend: EXLA.Backend]]
)

But it's still the same error.
The pattern match in the code requires 3 element but there is only 2 element tuple returned - check my last comment - when I edit this in the deps folder then it moves further.
With the flag not set it fails because there are only binaries for linux and macos available.
With the flag set I get:
** (Mix.Error) "nmake" not found in the path. If you have set the MAKE environment variable, please make sure it is correct.
I normally use linux but I just booted into windows to check how nn will perform on this computer.

Yes, we don’t have precompiled for Windows. So you would need both nmake and to set the flag. FWIW you can set it on the Setting page too.