Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can exo link Windows? #668

Open
wu21-web opened this issue Feb 2, 2025 · 5 comments
Open

Can exo link Windows? #668

wu21-web opened this issue Feb 2, 2025 · 5 comments

Comments

@wu21-web
Copy link

wu21-web commented Feb 2, 2025

No description provided.

@pyrater
Copy link

pyrater commented Feb 2, 2025

nope https://github.com/exo-explore/exo/issues?q=is%3Aissue%20state%3Aopen%20windows

@pyrater
Copy link

pyrater commented Feb 2, 2025

i stand corrected i was able to make it work on windows after a ton of messing around with WSL firewalls, python cuda installs etc

Image

@pyrater
Copy link

pyrater commented Feb 2, 2025

here is a completely unsupported windows install script.

`@echo off
title Exo Installation and Management Script
:menu
cls
echo ==========================================
echo Exo Installation Script
echo ==========================================
echo 1. Install WSL2 and Configure Environment
echo 2. Install and Run Exo in WSL
echo 3. Install PyTorch with CUDA in WSL
echo 4. Fix GPU Detection Issues
echo 5. Shutdown WSL
echo 6. Exit
echo ==========================================
set /p choice="Enter your choice: "

if "%choice%"=="1" goto install_wsl
if "%choice%"=="2" goto install_exo
if "%choice%"=="3" goto install_pytorch
if "%choice%"=="4" goto fix_gpu
if "%choice%"=="5" goto shutdown_wsl
if "%choice%"=="6" exit
goto menu

:install_wsl
cls
echo Checking WSL2 installation...
wsl --version >nul 2>&1
if %errorlevel%==0 (
echo WSL2 is already installed.
) else (
echo Installing WSL2...
wsl --install
if not %errorlevel%==0 (
echo WSL installation failed. Ensure you have administrative privileges.
pause
goto menu
)
)

echo Checking WSL2 default version...
wsl -l -v | findstr "VERSION 2" >nul 2>&1
if %errorlevel%==0 (
echo WSL2 is already the default version.
) else (
echo Setting WSL2 as the default version...
wsl --set-default-version 2
if not %errorlevel%==0 (
echo Failed to set WSL2 as default. Ensure your Windows version supports WSL2.
pause
goto menu
)
)

echo Checking if Ubuntu is installed...
wsl -l -v | findstr "Ubuntu" >nul 2>&1
if %errorlevel%==0 (
echo Ubuntu is already installed.
) else (
echo Installing Ubuntu...
wsl --install -d Ubuntu
if not %errorlevel%==0 (
echo Failed to install Ubuntu. Ensure WSL is properly set up.
pause
goto menu
)
)

echo Configuring .wslconfig file...
if exist "%USERPROFILE%.wslconfig" (
echo .wslconfig file already exists. Skipping configuration.
) else (
(
echo [wsl2]
echo gpu=true
echo networkingMode=mirrored
echo firewall=false
) > "%USERPROFILE%.wslconfig"
echo .wslconfig file created.
)

echo Checking firewall rules...
powershell -Command "Get-NetFirewallRule -DisplayName 'WSL UDP Exo'" >nul 2>&1
if %errorlevel%==0 (
echo Firewall rule for WSL UDP Exo already exists.
) else (
echo Adding firewall rule for WSL UDP Exo...
powershell -Command "New-NetFirewallRule -DisplayName 'WSL UDP Exo' -Direction Inbound -Action Allow -Protocol UDP -LocalPort 5678"
)

powershell -Command "Get-NetFirewallRule -DisplayName 'Allow WSL Python'" >nul 2>&1
if %errorlevel%==0 (
echo Firewall rule for Allow WSL Python already exists.
) else (
echo Adding firewall rule for Allow WSL Python...
powershell -Command "New-NetFirewallRule -DisplayName 'Allow WSL Python' -Direction Inbound -Action Allow -Program 'C:\Windows\System32\wsl.exe'"
)

echo WSL installation and configuration complete!
pause
goto menu

:install_exo
cls
echo Checking if Exo is already installed...
wsl -e bash -c "test -d ~/exo && echo 'Exo is already installed.'" | findstr "Exo is already installed." >nul 2>&1
if %errorlevel%==0 (
echo Exo is already installed.
) else (
echo Installing Exo...
echo Updating package lists and installing dependencies...
wsl -e bash -c "sudo apt update && sudo apt upgrade -y"
wsl -e bash -c "sudo apt install -y git python3 python3-pip python3-venv"
echo Cloning Exo repository...
wsl -e bash -c "git clone https://github.com/exo-explore/exo.git ~/exo"
echo Creating Python virtual environment and installing Exo...
wsl -e bash -c "python3 -m venv ~/exo/venv && source ~/exo/venv/bin/activate && pip install -e ~/exo"
)

echo Starting Exo with GPU support...
wsl -e bash -c "source ~/exo/venv/bin/activate && CUDA_VISIBLE_DEVICES=0 python ~/exo/main.py --node-host 0.0.0.0 --inference-engine=nvidia"

pause
goto menu

:install_pytorch
cls
echo Installing PyTorch with CUDA support in WSL...

echo Uninstalling existing PyTorch versions...
wsl -e bash -c "source ~/exo/venv/bin/activate && pip uninstall torch torchvision torchaudio -y"

echo Installing PyTorch with CUDA...
wsl -e bash -c "source ~/exo/venv/bin/activate && pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118"

echo Verifying PyTorch installation...
wsl -e bash -c "source ~/exo/venv/bin/activate && python -c 'import torch; print(torch.version); print(torch.cuda.is_available())'"

pause
goto menu

:fix_gpu
cls
echo Fixing GPU Detection Issues...
wsl -e bash -c "ls /dev | grep dxg"
if %errorlevel%==0 (
echo GPU passthrough is enabled.
) else (
echo GPU passthrough is missing! Updating WSL kernel...
wsl --update
wsl --shutdown
)

echo Checking if NVIDIA drivers are installed...
wsl -e bash -c "nvidia-smi"
if %errorlevel%==0 (
echo NVIDIA drivers are installed correctly.
) else (
echo ERROR: NVIDIA drivers are missing! Please install them from https://developer.nvidia.com/cuda/wsl/download
)

pause
goto menu

:shutdown_wsl
cls
echo Checking if WSL is running...
wsl --list | findstr "Ubuntu" >nul 2>&1
if %errorlevel%==0 (
echo Shutting down WSL...
wsl --shutdown
echo WSL successfully shut down!
) else (
echo WSL is not running. Nothing to shut down.
)

pause
goto menu
`

@pyrater
Copy link

pyrater commented Feb 2, 2025

still crashes when i try to prompt it

@ai-exo
Copy link

ai-exo commented Feb 9, 2025

I think there are a few mistakes involved in following those instructions but then again I'm a novice. Correct me if I'm wrong, I'm just discovering things as I go along in the great AI adventure...

You don't want to install another nvidia driver into wsl. The nvidia driver installed in windows is what does the job. You do install the cuda toolkit for wsl and cudnn for wsl though. You'll will also need to add the path to cuda to the bashrc file.
You must make sure that the pytorch version suits the cuda version, however 118 probably isn't the correct one in this case being for cuda 11. The present exo code appears to be set up around driver 560.xx and cuda 12.6? which would be pytorch 126.
If you use the most recent nvidia driver 570.xx and the toolkit offered at nvidia (not from archive) thats cuda 12.8 and the appropriate pytorch 128, isnt available for that yet.- won't be until July 2025 I believe. Also be careful not to download the cuda runfile file version because that also contains the driver and that isn't needed/wanted in wsl.

Hope that helps a fellow traveller.

BTW I think the inference engine = tinygrad rather than nvidia???

I want to thank the people developing this concept/code. I hope it will continue to be improved.
As someone who has only recently decided to find out about AI through the Deepseek R1 drop I have a lot to learn including how to do things in Linux(WSL). It would probably be appreciated by persons like myself if the contributors here could be a little more verbose than usual with their instructions. I understand Deepseek has had something like 10M downloads so I am sure there will be a few people landing here sometime with basic questions and a deficit of skills and knowledge.
Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants