jshprentz

jshprentz

Dependencies for nx in Livebook on Windows

I tried the Launch Week Day 2 example on a newly installed Livebook v0.9.1 running on Windows 11. As in the Day 2 video, I created a new notebook and added a neural network smart cell. I confirmed the popup to add the kino_bumblebee and torchx dependencies and restart. After some time and much output, it fails.

The notebook setup created automatically is:

Mix.install(
  [
    {:kino_bumblebee, "~> 0.2.1"},
    {:torchx, "~> 0.5.1"}
  ],
  config: [nx: [default_backend: Torchx.Backend]]
)

The error message is:

==> torchx
could not compile dependency :torchx, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile torchx", update it with "mix deps.update torchx" or clean it with "mix deps.clean torchx"
** (Mix.Error) "nmake" not found in the path. If you have set the MAKE environment variable,
please make sure it is correct.

    (mix 1.14.2) lib/mix.ex:513: Mix.raise/2
    (elixir_make 0.7.6) lib/elixir_make/compiler.ex:120: ElixirMake.Compiler.cmd/5
    (elixir_make 0.7.6) lib/elixir_make/compiler.ex:97: ElixirMake.Compiler.make/2
    (elixir_make 0.7.6) lib/elixir_make/compiler.ex:53: ElixirMake.Compiler.compile/1
    (mix 1.14.2) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (mix 1.14.2) lib/mix/tasks/compile.all.ex:92: Mix.Tasks.Compile.All.run_compiler/2
    (mix 1.14.2) lib/mix/tasks/compile.all.ex:72: Mix.Tasks.Compile.All.compile/4
    #cell:setup:1: (file)

I notice that the video shows different dependencies: kino_bumblebee and exla.

What other dependencies and setup steps do I need to run the neural network examples in Livebook on Windows?

Most Liked

jshprentz

jshprentz

Thanks. I will try the Docker image.

I was able to get many of the neural network features working after some trial and error. These steps led to success:

  1. Install Microsoft C++ development tools.
  2. Install CUDA 11.6
  3. Install cuDNN 8.9.0
  4. Disable Python aliases in Windows Settings/Manage App Execution Aliases
  5. Apply Microsoft development environment variables to the Livebook notebook setup cell.
  6. Add additional environment variables reported in error messages.
  7. Click “Reconnect and setup” above the setup cell.

To capture the Microsoft development environment variables, run

cmd /K "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64

and type set to show all environment variables. Edit them into an Elixir map passed to Mix.install as system_env.

In response to error messages, I added CUDNN_ROOT, LIBTORCH_TARGET, and PYTHON.

With those changes, the setup cell begins with the following contents. Paths, versions, and unrelated environment variables may vary on other computers.

Mix.install(
  [
    {:kino_bumblebee, "~> 0.2.1"},
    {:torchx, "~> 0.5.1"}
  ],
  config: [nx: [default_backend: Torchx.Backend]],
  system_env: %{
    "LIBTORCH_TARGET" => "cu116",
    "CUDNN_ROOT" => "C:\\Program Files\\NVIDIA\\CUDNN\\v8.9",
    "PYTHON" => "C:\\Users\\Joel\\AppData\\Local\\Programs\\Python\\Python39\\python.exe",
    
    "ALLUSERSPROFILE" => "C:\\ProgramData",
    "APPDATA" => "C:\\Users\\Joel\\AppData\\Roaming",
    "CARBON_MEM_DISABLE" => "1",
    "ChocolateyInstall" => "C:\\ProgramData\\chocolatey",
    "ChocolateyLastPathUpdate" => "133196555883524332",
    "CommandPromptType" => "Native",
    "CommonProgramFiles" => "C:\\Program Files\\Common Files",
    "CommonProgramFiles(x86)" => "C:\\Program Files (x86)\\Common Files",
    "CommonProgramW6432" => "C:\\Program Files\\Common Files",
    "COMPUTERNAME" => "JOELS-DELL-XPS-",
    "ComSpec" => "C:\\Windows\\system32\\cmd.exe",
    "CUDA_PATH" => "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.6",
    "CUDA_PATH_V11_6" => "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.6",

I have not attempted to repeat this setup from scratch on a clean machine.

Where Next?

Popular in Questions Top

pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New

We're in Beta

About us Mission Statement