# cuda

Copied from here: https://www.reddit.com/r/chia/comments/18z4lnp/how_to_install_bladbit_cuda_on_ubuntu/

My steps (I am running ubuntu 22.04, i Had problems with 24.10 due to some dependencies)


I preffer installing the drivers from PPA to get an updated version but "sudo apt install nvidia-driver-535" would also work. the important part is to verify with "nvidia-smi" after reboot


----------------Install NVIDIA Drivers on Ubuntu 22.04 via CUDA PPA------------

```bash
sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https dkms curl -y
```

#import the GPG key

```bash
curl -fSsL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | sudo gpg --dearmor | sudo tee /usr/share/keyrings/nvidia-drivers.gpg > /dev/null 2>&1
```

#add the NVIDIA repository for your system

```bash
echo 'deb [signed-by=/usr/share/keyrings/nvidia-drivers.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /' | sudo tee /etc/apt/sources.list.d/nvidia-drivers.list
```
```bash
sudo apt update
```
Check available Dirver
```bash
apt search nvidia-driver-*
```
I Chose driver-545 that is a newer driver than the avaiable on the ubuntu repository for 22.04
```bash
sudo apt install nvidia-driver-545 cuda
```
#Check Driver version
```bash
nvidia-smi
```
----------------Install BaldeBit CUDA------------

#install pre-req
```bash
sudo apt install -y build-essential cmake libgmp-dev libnuma-dev
```
#Build
```bash
cd
```
```bash
git clone https://github.com/Chia-Network/bladebit.git
```
```bash
cd bladebit
```
```bash
git checkout cuda-compression
```
```bash
mkdir -p build-release && cd build-release
```
```bash
cmake .. && cmake --build . --config Release --target bladebit_cuda -j$(nproc --all)
```
#run
```bash
cd ~/bladebit/build-release
```
```bash
./bladebit_cuda -n 1 -f XXX -c XXX --compress XXX cudaplot /media/temp_plots
```
#replace with your farmer key, pool contract, compresion level and save directory

---------------Some Other must have --------------------

#-----monitoring with a nice terminal GUI---------
```bash
sudo apt install bpytop
```
```bash
bytop
```
#---------Moving plots to a final destination---------
```bash
cd
```
```bash
git clone https://github.com/lmacken/plow.git
```
#edit plow configuration (most important "SOURCES =" & "DESTS ="
```bash
sudo nano ./plow/plow.py
```
#install Python
```bash
sudo apt install python3-pip
```
```bash
pip install aionotify
```
```bash
python3 ./plow/plow.py
```