Hey y’all - I’ve been running into some issues getting CUDA to actually work as a backend for Livebook. Unfortunately, there’s not a lot of documentation out there so here we are. Here’s the simplest repro:
Starting from this gist: Livebook + CUDA? · GitHub
-
nix develop
theflake.nix
livebook start
- Open the web page then →
Open
→From source
(or From URL), and evaluate thetest_cuda.livemd
.
It will fail at the last step with:
There was an error before creating cudnn handle (302): Error loading CUDA libraries. GPU will not be used. : Error loading CUDA libraries. GPU will not be used.
My guess here is that the EXLA library downloads a precompiled XLA binary as part of installation: nx/exla at main · elixir-nx/nx · GitHub
I don’t really know much about how the various CUDA libraries interact with each other so I’m not sure what is going on. It clearly detects that cuda
is available from the call. Tracing that error, it comes from xla
libcudart
: xla/xla/tsl/cuda/cudart_stub.cc at e4ee0fec3dbfb53c61a11d5afac7f0dd6c559e5c · openxla/xla · GitHub
I’ve tried adding all the various cudaPackages
into buildInputs
and even setting LD_LIBRARY_PATH
. I don’t know if I also need to do some rpath
patching?
Appreciate any input - thanks!