Can anyone post a link to a Livebook that uses Nvidia/Cuda to run simple Nx benchmarks?

Can anyone post a link to a Livebook that uses Nvidia/Cuda to run simple Nx benchmarks? (my dev platform is ubuntu 22.04) TIA

1 Like

Axon has guide pages for Acceleration and Training just below it, using EXLA which can use CUDA.

Bumblebee likewise has a guide page for Fine Tuning which can use EXLA for speedups.

I can also endorse the current content for Sean’s ML In Elixir book if you want to dig deeper. I look forward to seeing it fleshed out over time.

If you just want to confirm that you have it all wired up correctly driver-wise, I have a trivial Livebook that sets up the CUDA target here and creates a tensor on it, which is roughly pulled from one of the packages’ HexDocs but I no longer remember which one.

I use it with a 12GB 3060that I bought when I saw how dismal the outlook is for ROCm, which mostly doesn’t support consumer cards. Looks longingly at my 6900XT…

2 Likes

I won’t be able to help you with the driver set up because I’m on a different Linux distribution. I can say that it worked perfectly from the ~first Google hits when I had demo’d PopOS, so I’m optimistic you won’t have much trouble compared to my NixOS requirements.

1 Like

@shanesveller - am using a Nvidia GeForce RTX 3060 on a Thunderbolt eGPU - blindly installing drivers - here’s what I did:

> sudo ubuntu-drivers install nvidia-driver-525
> sudo apt install libcuda-11.7-1
> sudo apt install libnvidia-compute-525
> sudo apt install nvidia-utils-525
> sudo apt install nvidia-utils-525-server
> sudo apt install nvidia-cuda-dev nvidia-cuda-toolkit nvidia-cuda-gdb -yq
> sudo apt install libcudnn8 -yq
> sudo apt install libcudnn8-dev -yq
> sudo apt install libcudnn8-samples -yq
> sudo snap install nvtop 

Driver test works with nvidia-smi and nvtop

And your livebook works!!! Thanks very much for posting!!

Does anyone else find the Nvidia drivers to be confusing? What is the best way to learn the CUDA ecosystem? Brute force trial-and-error? Blogs? This forum?

3 Likes

I usually use the Nvidia driver that is listed as tested under Software & Updates / Additional Drivers.

For example (from Ubuntu 23.10)

3 Likes