Score:0

Script to Adjust Power to GPUs on Startup won't Run Automatically

cn flag

I've been trying to simplify the process of restarting my Ether mining rigs so I don't have to set up the terminal and manually clock each GPU.

I wrote a script to run in systemd. The text of the .sh and the .service files will be below.

The .sh consists of two parts. The first clocks each of the nine cards then the second runs the mining application.

On startup, the first part of the script doesn't run, but the second part to initialize mining does.

When I run the .sh directly both parts do run correctly; the power is set and mining is started. When I run a start command on the .service directly in Terminal it runs into the same incomplete execution as when it runs at boot.

The service has been enabled. The file pathways are correct. The permissions to run the sudo lines have been given.

I've read through just about every source I could find, and I and my partner are stumped as to where the disconnect is.

What in the script needs to be changed to get this to execute?

Below are the .sh and the .service:

start.sh

#!/bin/sh

sudo nvidia-smi -i 0 -pl 70

sudo nvidia-smi -i 1 -pl 70

sudo nvidia-smi -i 2 -pl 70

sudo nvidia-smi -i 3 -pl 70

sudo nvidia-smi -i 4 -pl 70

sudo nvidia-smi -i 5 -pl 70

sudo nvidia-smi -i 6 -pl 70

sudo nvidia-smi -i 7 -pl 70

sudo nvidia-smi -i 8 -pl 70

#!/bin/sh

/home/rigf/Desktop/mine/t-rex-0.22.1-linux/t-rex -a ethash -o stratum+tcp://stratum-eth.antpool.com:8008 -u 0xE19e9BC0d9D9C178E51BC8C04F788cDF6a123a36 -p x -w RigF

rigstart.service

[Unit]

Description=Rig boot protocol

[Service]

Type=simple

ExecStart=/home/rigf/Desktop/mine/t-rex-0.22.1-linux/start.sh

[Install]

WantedBy=multi-user.target

This is being done on Ubuntu 20.04.3.

waltinator avatar
it flag
The `sudo` commands are superfluous. Services run as `root`. The `PATH` of the service doesn't include the directory containing `nvidia-smi`, use an absolute path.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.