# Connecting GPU to Cluster

## **Windows and Ubuntu Setup Guide**

### **CPU Setup**

1. Download Docker:

* Visit Docker's official website and download Docker for your OS.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcnCt87rMHYL414IIHan-qmxorOqLF0UaNdAiLLe6q4kTGPq8yKYHiSFQtMkBbnptIm9UEmH3KhS_kBPwwfaCqY0vDWc-yJQcv6mHpcKRXA7vxIgHQ4wgygqntDKekQ2FNwJmHa1t7bSEJ0qCBPc7keQukk?key=MxYxJdYSbAkS9lUYtW4xqA" alt="" width="375"><figcaption></figcaption></figure>

2. Open Command Prompt:\
   \
   \- Windows: Open Command Prompt.\
   \- Ubuntu: Open Terminal.
3.  Execute Docker Pull Command:\
    \
    `docker pull zkagi/connect2cluster:latest`\
    \
    \
    \


    <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcqlCXoHFrPefaAaEswXWjaI99cMjYwujhyvy0B5uZRWEDDgZnj4sj6AjgRX-4oFlocHAdgJhLaR_lttzjDcrvYRfwLy9rAd-XHl0aUgYF4ltZFfWK9OSmGU3LrY24JI3h9Erx77fn4bbQQvnunhjAkxr-u?key=MxYxJdYSbAkS9lUYtW4xqA" alt="" width="375"><figcaption></figcaption></figure>
4.  Run Docker Container:\
    \
    `docker run -dit -e "walletAddress=YOUR_WALLET_ADDRESS" --privileged --network host zkagi/connect2cluster`\
    \


    <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd6FWOQk2Yxy2rQKS-vnyWTTos8ARHp_xrElCGzFvynBBb7YHEF-ZIQQ4tXKTkKB0v4Hs0Wdywi9up0DdrLnj6td4-ey6ljvdsW3Z1zNGOKPJ-EZG6aEhIle-gBLVXMF8aMuJQkiufiUCBfMSssFGmS9gQ?key=MxYxJdYSbAkS9lUYtW4xqA" alt="" width="375"><figcaption></figcaption></figure>
5. Connect:

* Wait for 20 seconds.
* Click on the connect button in the ZkAGI interface.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdZN4JjPnIJBTnmBBli3iADQUTWdBrJNQ2X7NUc7Mndt6tG7CqTqQUdVaD0ykOQcRNHG9yHdk8w61mlYe8bnMLeOGg7HKY-w4jcWwgVt0ycUQYuMTGDzObAmRiSC33j78hYvE-VmgbXlFi50Qn4Gs8-knxr?key=MxYxJdYSbAkS9lUYtW4xqA" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeWRNQeqhdZ11uYkz3fIujSvn3--nTrC_Aq1pojjnITZ8fjse4tlOe67rJDGe3S8S4xoopVu_4j8avGeB5_MGVNz3JzqiYVJcL13iY6EMbR8QMjfLQEV6UWHzfswTNuyXVNV1z9f6z1fwkejLp1NhN4P8E4?key=MxYxJdYSbAkS9lUYtW4xqA" alt="" width="375"><figcaption></figcaption></figure>

### **GPU Setup**

1. Download Docker:\
   \- Visit Docker's official website and download Docker for your OS.
2. Check GPU and Drivers:\
   \- Open Command Prompt (Windows) or Terminal (Ubuntu).
3. Run the following command to check your GPU name and drivers:\
   `nvidia-smi`
4. Driver Version Check:\
   \- If your driver version is > 552, downgrade it using the following[ link](https://www.nvidia.com/download/driverResults.aspx/224484/en-us/).
5. Open Command Prompt:\
   \- Windows: Open Command Prompt.\
   \- Ubuntu: Open Terminal.
6. Execute Docker Pull Command:\
   \
   `docker pull zkagi/connect2cluster:gpu-latest`\

7. Run Docker Container:\
   \
   `docker run -dit -e "walletAddress=YOUR_WALLET_ADDRESS" --privileged --network host --gpus all zkagi/connect2cluster`\

8. Connect:

* Wait for 20 seconds.
* Click on the connect button in the ZkAGI interface.

## **Disconnecting CPU/GPU Connection**

To disconnect the running container, execute the following command in Command Prompt or Terminal:

### Windows:

`FOR /F "tokens=*" %i IN ('docker ps -q --filter "ancestor=zkagi/connect2cluster"') DO docker stop %i`

### Ubuntu:

`docker ps -q --filter "ancestor=zkagi/connect2cluster" | xargs docker stop`\
\


## **Restarting CPU/GPU Connection**

To restart the stopped container, execute the following command in Command Prompt or Terminal:

### Windows:

`FOR /F "tokens=*" %i IN ('docker ps -a -q --filter "ancestor=zkagi/connect2cluster"') DO docker restart %i`



### Ubuntu:

`docker ps -a -q --filter "ancestor=zkagi/connect2cluster" | xargs -I {} docker restart {}`

\


\




\
\
