My general advice / tips for compiling mistral.rs
in WSL2
#556
joshuasundance-swca
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
also posted as a gist
some of this advice is also helpful for just getting
mistral.rs
docker images to work with WSL2 + GPU backendlet me know if you have any questions :)
This document is a quick-and-dirty guide to compiling
mistral.rs
in WSL2, but it probably contains useful information for anyone trying to build CUDA applications in WSL2.mistral.rs
: Blazingly fast LLM inference.https://github.com/EricLBuehler/mistral.rs
REQUIREMENTS
Install WSL2 and/or run
wsl --update
after installing the latest Windows updates. I'm using Ubuntu.https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements
Compatible kernel, gcc, and glibc
EXAMPLE:
Ubuntu 20.04.z (z <= 6) LTS
STEP 1: CUDA in Windows
Get cuda working in Windows. Details are beyond the scope of this document.
STEP 2: CUDA in WSL
Get cuda working in WSL without overwriting the driver inherited from Windows
WARNING:
From https://docs.nvidia.com/cuda/wsl-user-guide/index.html
Once a Windows NVIDIA GPU driver is installed on the system, CUDA becomes available within WSL 2.
The CUDA driver installed on Windows host will be stubbed inside the WSL 2 as
libcuda.so
,therefore users must not install any NVIDIA GPU Linux driver within WSL 2.
One has to be very careful here as the default CUDA Toolkit comes packaged with a driver,
and it is easy to overwrite the WSL 2 NVIDIA driver with the default installation.
We recommend developers to use a separate CUDA Toolkit for WSL 2 (Ubuntu)
available from the CUDA Toolkit Downloads page to avoid this overwriting.
This WSL-Ubuntu CUDA toolkit installer will not overwrite the NVIDIA driver
that was already mapped into the WSL 2 environment.
To learn how to compile CUDA applications, please read the CUDA documentation for Linux.
Installation
Follow the instructions at https://docs.nvidia.com/cuda/wsl-user-guide/index.html#cuda-support-for-wsl-2 (section 3, Option 1)
Test your installation
STEP 3: Get ready to build & run
mistral.rs
Install stuff you'll need to compile
mistral.rs
:Alter environment variables in
~/.bashrc
PATH
makes sure you can run thenvcc
compiler and stuffLD_LIBRARY_PATH
makes sure you can actually run the binaries after compiling themDriverError(CUDA_ERROR_NO_DEVICE, "no CUDA-capable device is detected")
LD_LIBRARY_PATH
if you don't need toAlter the following lines for your version of CUDA and then add them to the end of
~/.bashrc
STEP 4: Build & run
mistral.rs
mistral.rs
, ieBeta Was this translation helpful? Give feedback.
All reactions