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

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
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

Other popular topics Top

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement