-
Notifications
You must be signed in to change notification settings - Fork 5
Installation
In order to be a swarm node, you need a CUDA capable NVIDIA GPU with at least 8GB of VRAM; 30XX or better recommended.
git clone https://github.com/dkackman/chiaSWARM.git
cd chiaSWARM
From the repo root run sh install.sh
on Linux or install.ps1
on Windows. These scripts will create a virtual environment and install the swarm to it.
It will ask for sudo
privileges on ubuntu in order to get and install the correct python and dependencies.
For updates, just make sure that you are not in the virtual environment by executing before running the install script.
deactivate # if you are in the virtual environment
git pull
After that, updating and new installations follow the same steps. The initialize
command will download all of the AI model files, which is 10's of gigabytes. This only needs to be done once after installation and occasionally as models are added or updated.
sh install.sh
. ./activate
python -m swarm.initialize
If, when running the powershell script you see an error about not being able to run scripts, you will need to enable powershell script execution with an execution policy.
# this part needs to be run as an administrator
Set-ExecutionPolicy Unrestricted
.\install.ps1
venv\Scripts\activate
python -m swarm.initialize
The swarm.initialize
command will ask for your swarm access token and the swarm uri. The current swarm uri is https://chiaswarm.ai. It will also download all of the needed machine learning models which will take quite some time. It only needs to be run once.
After the models are downloaded, start the worker
python -m swarm.worker
The docker image needs a bind mount for the huggingface model cache. Set src
in the example below as appropriate to /home/USER_NAME/.cache/huggingface
, C:\Users\USER_NAME\.cache\huggingface
or some other location on the host system.
docker pull dkackman/chiaswarm
# only needs to be run once. files will be cached on the host
docker run \
--mount "src=/home/YOUR_USERNAME/.cache/huggingface,target=/root/.cache/huggingface/" \
dkackman/chiaswarm \
python -m swarm.initialize --silent
# starts the swarm worker
docker run \
--mount "src=/home/YOUR_USERNAME/.cache/huggingface,target=/root/.cache/huggingface/" \
--gpus all \
--env SDAAS_TOKEN=YOUR TOKEN \
dkackman/chiaswarm