├── .gitignore ├── burn.sh ├── create_raid.sh ├── fan_control.sh ├── get_aers.sh ├── gpu_reset.sh ├── install_nvidia.sh ├── limit_power.sh ├── logo ├── build.sh ├── logo.png └── logo.svg ├── new_user.sh ├── screen.py ├── temps.sh ├── tst_disk.sh ├── tst_gpu.sh └── tst_raid.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | -------------------------------------------------------------------------------- /burn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd ~/build/HIP-Examples/gpu-burn/build 3 | ./gpuburn-hip -t 100 4 | -------------------------------------------------------------------------------- /create_raid.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mdadm --create --verbose /dev/md0 --level=0 --raid-devices=4 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 3 | mkfs.ext4 /dev/md0 4 | mkdir -p /raid 5 | mount /dev/md0 /raid/ 6 | mkdir -p /raid/weights 7 | mkdir -p /raid/datasets 8 | chown tiny:tiny /raid/weights /raid/datasets 9 | 10 | -------------------------------------------------------------------------------- /fan_control.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # https://www.asrockrack.com/support/faq.cn.asp?id=63 3 | 4 | # auto 5 | sudo ipmitool raw 0x3a 0xd8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 6 | 7 | # manual (50%) 8 | #sudo ipmitool raw 0x3a 0xd8 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 9 | #sudo ipmitool raw 0x3a 0xd6 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 10 | 11 | # manual (100%) 12 | #sudo ipmitool raw 0x3a 0xd8 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 13 | #sudo ipmitool raw 0x3a 0xd6 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 14 | -------------------------------------------------------------------------------- /get_aers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo dmesg | grep " device_id" 3 | -------------------------------------------------------------------------------- /gpu_reset.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | /opt/rocm/bin/rocm-smi --gpureset -d 0 3 | /opt/rocm/bin/rocm-smi --gpureset -d 1 4 | /opt/rocm/bin/rocm-smi --gpureset -d 2 5 | /opt/rocm/bin/rocm-smi --gpureset -d 3 6 | /opt/rocm/bin/rocm-smi --gpureset -d 4 7 | /opt/rocm/bin/rocm-smi --gpureset -d 5 8 | -------------------------------------------------------------------------------- /install_nvidia.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd /tmp 3 | wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb 4 | sudo dpkg -i cuda-keyring_1.1-1_all.deb 5 | sudo apt-get update 6 | sudo apt-get -y install cuda-toolkit-12-4 nvidia-driver-550-open cuda-drivers-550 7 | -------------------------------------------------------------------------------- /limit_power.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | /opt/rocm/bin/rocm-smi --setpoweroverdrive 150 3 | /opt/rocm/bin/rocm-smi -d 0 --setpoweroverdrive 327 4 | -------------------------------------------------------------------------------- /logo/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | convert -density 366 -crop 800x480+0+0 logo.svg png32:logo.png 3 | file logo.png -------------------------------------------------------------------------------- /logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinygrad/tinybox/984a63a17ee40c42483d76b7dbac22e69f1ce6eb/logo/logo.png -------------------------------------------------------------------------------- /logo/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /new_user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | adduser $1 --disabled-password 3 | usermod -a -G sudo $1 4 | usermod -a -G render $1 5 | usermod -a -G video $1 6 | su - $1 -c "mkdir /home/$1/.ssh" 7 | su - $1 -c "echo $2 > /home/$1/.ssh/authorized_keys" 8 | -------------------------------------------------------------------------------- /screen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import serial, math 3 | import time 4 | 5 | # COMMANDS 6 | # from lcd_comm_rev_c.py 7 | HELLO = bytearray((0x01, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc5, 0xd3)) 8 | OPTIONS = bytearray((0x7d, 0xef, 0x69, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x2d)) 9 | RESTART = bytearray((0x84, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01)) 10 | TURNOFF = bytearray((0x83, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01)) 11 | TURNON = bytearray((0x83, 0xef, 0x69, 0x00, 0x00, 0x00, 0x00)) 12 | 13 | SET_BRIGHTNESS = bytearray((0x7b, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00)) 14 | 15 | # STOP COMMANDS 16 | STOP_VIDEO = bytearray((0x79, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01)) 17 | STOP_MEDIA = bytearray((0x96, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01)) 18 | 19 | # IMAGE QUERY STATUS 20 | QUERY_STATUS = bytearray((0xcf, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01)) 21 | 22 | # STATIC IMAGE 23 | START_DISPLAY_BITMAP = bytearray((0x2c,)) 24 | PRE_UPDATE_BITMAP = bytearray((0x86, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01)) 25 | UPDATE_BITMAP = bytearray((0xcc, 0xef, 0x69, 0x00)) 26 | 27 | RESTARTSCREEN = bytearray((0x84, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01)) 28 | DISPLAY_BITMAP = bytearray((0xc8, 0xef, 0x69, 0x00, 0x17, 0x70)) 29 | 30 | STARTMODE_DEFAULT = bytearray((0x00,)) 31 | STARTMODE_IMAGE = bytearray((0x01,)) 32 | STARTMODE_VIDEO = bytearray((0x02,)) 33 | FLIP_180 = bytearray((0x01,)) 34 | NO_FLIP = bytearray((0x00,)) 35 | SEND_PAYLOAD = bytearray((0xFF,)) 36 | 37 | def pad(message): 38 | msg_size = len(message) 39 | if not (msg_size / 250).is_integer(): 40 | pad_size = (250 * math.ceil(msg_size / 250) - msg_size) 41 | message += b"\x00" * pad_size 42 | return message 43 | 44 | if __name__ == "__main__": 45 | ser = serial.Serial("/dev/ttyACM0", 115200, timeout=1, rtscts=1) 46 | ser.write(pad(HELLO)) 47 | resp = ser.read(22) 48 | print(resp.decode()) 49 | ser.write(pad(SET_BRIGHTNESS + b"\x40")) 50 | time.sleep(1) 51 | ser.write(pad(SET_BRIGHTNESS + b"\x00")) 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /temps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | RED='\033[0;31m' 3 | NC='\033[0m' 4 | echo -e "${RED}gpus${NC}" 5 | sudo sensors | grep edge 6 | echo -e "${RED}disks${NC}" 7 | nvme smart-log /dev/nvme0 -H | grep temperature 8 | nvme smart-log /dev/nvme1 -H | grep temperature 9 | nvme smart-log /dev/nvme2 -H | grep temperature 10 | nvme smart-log /dev/nvme3 -H | grep temperature 11 | echo -e "${RED}network${NC}" 12 | # https://network.nvidia.com/products/adapter-software/firmware-tools/ 13 | mget_temp -d /dev/mst/mt4121_pciconf0 14 | #mget_temp -d /dev/mst/mt4123_pciconf0 15 | -------------------------------------------------------------------------------- /tst_disk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dd if=/dev/nvme0n1 of=/dev/zero iflag=direct bs=16M count=500 & 3 | dd if=/dev/nvme1n1 of=/dev/zero iflag=direct bs=16M count=500 & 4 | dd if=/dev/nvme2n1 of=/dev/zero iflag=direct bs=16M count=500 & 5 | dd if=/dev/nvme3n1 of=/dev/zero iflag=direct bs=16M count=500 & 6 | for job in `jobs -p` 7 | do 8 | wait $job 9 | done 10 | -------------------------------------------------------------------------------- /tst_gpu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | /opt/rocm/bin/rocm-bandwidth-test 3 | -------------------------------------------------------------------------------- /tst_raid.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo dd if=/dev/md0 of=/dev/null bs=256M count=500 iflag=direct 3 | --------------------------------------------------------------------------------