NOTE: If you don't need to change the code, please use the prebuilt packages to start the node:
Start a Crynux Node to share the spared local GPU to others in exchange for tokens. Crynux Node will join the Crynux Network, receive the AI inference/training/fine-tuning tasks from the network, and execute them locally.
Copy config/config.yml.shell_example
to config/config.yml
. And adjust the file content according to your need:
# In the root folder of the project
$ cp config/config.yml.shell_example config/config.yml
- Create the venv in the root folder of the project:
# In the root folder of the project
$ python -m venv venv
- Activate the venv and install the requirements:
# In the root folder of the project
# Use ./venv/Scripts/Activate.ps1 on Windows
$ ./venv/bin/activate
# Use requirements_macos.txt on Mac
(venv) $ pip install -r ./requirements_docker.txt
(venv) $ pip install .
- Get the source code of stable-diffusion-task and gpt-task using Git submodule:
# In the root folder of the project
$ git submodule update --init --recursive
- Create a folder named "worker" under the root folder of the project, and copy
src/crynux_worker_process.py
to the folder:
# In the root folder of the project
$ mkdir worker
$ cp src/crynux_worker_process.py worker/
- Create the venv under the worker folder:
# In the root folder of the project
$ cd worker
$ python -m venv venv
- Activate the venv and install the requirements for stable-diffusion-task and gpt-task:
# In the worker folder
# Use ./venv/Scripts/Activate.ps1 on Windows
$ ./venv/bin/activate
# Install the stable-diffusion-task package
(venv) $ cd ../stable-diffusion-task
## Use requirements_macos.txt on Mac
(venv) $ pip install -r requirements_cuda.txt
(venv) $ pip install .
# Install the gpt-task package
(venv) $ cd ../gpt-task
# Use requirements_macos.txt on Mac
(venv) $ pip install -r requirements_cuda.txt
(venv) $ pip install .
- Prepare the config file
# Go to the root folder of the webui
$ cd src/webui
# Create the config file from the example
$ cp src/config.example.json src/config.json
- Build the WebUI distribution package
# In the root folder of the webui
# Install the dependencies
$ yarn
# Build the package
$ yarn build
Activate the server's venv, and start from the src/app/main.py
script:
# In the root folder of the project
# Use ./venv/Scripts/Activate.ps1 on Windows
$ ./venv/bin/activate
(venv) $ python src/app/main.py
- Clone the project
# git clone https://github.com/crynux-ai/crynux-node.git
- Go to the root folder of the project
# cd crynux-node
- Build the Docker image
# docker build -t crynux-node:dev -f .\build\Dockerfile .
- Start the container
# docker run -d -p 127.0.0.1:7412:7412 --gpus all crynux-node:dev
Please refer to the README for the detailed instructions on building the MacOS binary package.
Please refer to the README for the detailed instructions on building the Windows binary package.
- Clone the project
# git clone https://github.com/crynux-ai/crynux-node.git
- Go to the root folder of the project
# cd crynux-node
- Install the dependencies and package (preferably in a virtualenv)
# pip install -r requirements_docker.txt && pip install .[test]
- Run tests
# pytest tests