Destra-DGPU is a Python package for starting and managing a GPU Worker Node in the Destra GPU Network.
This library is designed to handle all things related to Destra GPU Worker Node, including installing the NVidia drivers for the available GPUs, installing all the required dependency libraries, starting the GPU Worker Node, registering with the Destra GPU Registry, and stopping the GPU Worker Node.
- Destra GPU Registry: 0x9B1B198C5C671F8B5a67721cC4Fff5E9F020D505 (deployed on testnet)
- Ubuntu system
- NVidia GPU
- Stable internet connection
- Access to network firewall settings
- Sepolia RPC
- Wallet with 0.1 Sepolia ETH
First, clone the GitHub repository to your local machine.
git clone https://github.com/DestraNetwork/destra-dgpu.git
cd destra-dgpu
This script installs the necessary drivers for your GPU. Ensure you have the necessary permissions to execute the script.
cd destra-dgpu
chmod +x install_drivers.sh
sudo ./install_drivers.sh
Ensure you have Python 3.9.6 installed. You can either install from source or use pyenv
to manage your Python versions.
-
Install Required Build Tools:
sudo apt-get update sudo apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl libbz2-dev
-
Download and Extract Python Source Code:
cd /usr/src sudo wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz sudo tar xzf Python-3.9.6.tgz
-
Build and Install Python:
cd Python-3.9.6 sudo ./configure --enable-optimizations sudo make altinstall
-
Install
pyenv
:curl https://pyenv.run | bash
Add the following lines to your shell configuration file (e.g.,
~/.bashrc
,~/.zshrc
):export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"
Restart your shell or source the configuration file:
source ~/.bashrc source ~/.zshrc
-
Install Python 3.9.6:
pyenv install 3.9.6 pyenv global 3.9.6
Create and activate a virtual environment for your project.
python3.9 -m venv dgpu-env
source dgpu-env/bin/activate
Install the destra-dgpu
package from the provided wheel file.
cd ~/destra-dgpu
pip install destra-dgpu/destra_dgpu-0.1.0-cp39-cp39-linux_x86_64.whl
Set the environment variable NODE_OPERATOR_PRIVATE_KEY
with your private key. Replace YourPrivateKeyHere
with your actual private key (without the 0x
prefix). Ensure atleast 0.1 Sepolia ETH.
export NODE_OPERATOR_PRIVATE_KEY=YourPrivateKeyHere
It is recommended to use tmux
to manage the session and keep the GPU worker node running in the background.
-
Install
tmux
:sudo apt-get install tmux
-
Start a new
tmux
session:tmux new -s destra-gpu
-
Start the GPU worker node. Replace
<destra_gpu_registry_contract_address>
and<sepolia_rpc_endpoint>
with the appropriate values.destra-gpu-start-worker <destra_gpu_registry_contract_address> <sepolia_rpc_endpoint>
Example:
destra-gpu-start-worker 0x9B1B198C5C671F8B5a67721cC4Fff5E9F020D505 https://sepolia.infura.io/v3/<YOUR_INFURA_KEY>
-
Detach from the
tmux
session by pressingCtrl+b
, thend
. This will keep the session running in the background.To reattach to the session later, use:
tmux attach -t destra-gpu
To stop the GPU worker node, run the following command from anywhere:
destra-gpu-stop-worker
If you encounter any issues, ensure that:
- The environment variables are set correctly.
- The necessary dependencies are installed.
- The correct Python version is being used.
- You have a NVidia GPU
- The
install_drivers.sh
script was executed successfully. - If you run a node with incompatible GPU or w/o GPU, no tasks will be assigned.
If you still face any issues, contact us on our telegram channel.