You are not logged in.

#1 2018-06-05 06:45:56

kmsgli
Member
Registered: 2015-08-15
Posts: 33

Systemd: Issue running Nvdia settings shell script on boot

I am having an issue understanding what my issue is.  I am running a GPU miner and naturally rather then use Ubuntu like everyone else I opted to use Arch as I use Arch for everything else.

I have everything working correctly and having some issue getting systemd to auto start my GPU settings.  I can use systemd to auto start the ethminer program with no issues but for some reason systemd does not want to run the GPU tweak settings script.


Here is the script that runs ethminer

!/bin/bash
/home/archminer/ethminer/bin/ethminer -U --farm-recheck 200 -P stratum1+tcp://walletadd.@eth-us-east1.nanopool.org:9999/Archminer

and here is the systemd service that starts the above script on boot

[Unit]
Description=Ethereum Miner Process
Requires=multi-user.target
After=multi-user.target

[Service]
User=archminer
Type=simple
WorkingDirectory=/home/archminer/ethminer/bin
PermissionsStartOnly=true
ExecStart=/home/archminer/ethminer/startminer.sh
Restart=on-failure

[Install]
WantedBy=default.target

that works just fine but when I use the same systemd service but change the shell script to the nvidia script to adjust gpu settings it does not run

nvidia shell script:

#!/bin/bash

#set fan speeds
nvidia-settings -a [gpu:0]/GPUFanControlState=1
nvidia-settings -a [fan:0]/GPUTargetFanSpeed=80

nvidia-settings -a [gpu:1]/GPUFanControlState=1
nvidia-settings -a [fan:1]/GPUTargetFanSpeed=80

nvidia-settings -a [gpu:2]/GPUFanControlState=1
nvidia-settings -a [fan:2]/GPUTargetFanSpeed=80

nvidia-settings -a [gpu:3]/GPUFanControlState=1
nvidia-settings -a [fan:3]/GPUTargetFanSpeed=80

nvidia-settings -a [gpu:4]/GPUFanControlState=1
nvidia-settings -a [fan:4]/GPUTargetFanSpeed=80

nvidia-settings -a [gpu:5]/GPUFanControlState=1
nvidia-settings -a [fan:5]/GPUTargetFanSpeed=80


# set gpu offest 
nvidia-settings -a [gpu:0]/GPUGraphicsClockOffset[3]=-100

nvidia-settings -a [gpu:1]/GPUGraphicsClockOffset[3]=-100

nvidia-settings -a [gpu:2]/GPUGraphicsClockOffset[3]=-100

nvidia-settings -a [gpu:3]/GPUGraphicsClockOffset[3]=-100

nvidia-settings -a [gpu:4]/GPUGraphicsClockOffset[3]=-100

nvidia-settings -a [gpu:5]/GPUGraphicsClockOffset[3]=-100


#set gpu clock speed
nvidia-settings -a [gpu:0]/GPUMemoryTransferRateOffset[3]=1400

nvidia-settings -a [gpu:1]/GPUMemoryTransferRateOffset[3]=1400 

nvidia-settings -a [gpu:2]/GPUMemoryTransferRateOffset[3]=1400

nvidia-settings -a [gpu:3]/GPUMemoryTransferRateOffset[3]=1400

nvidia-settings -a [gpu:4]/GPUMemoryTransferRateOffset[3]=1400

nvidia-settings -a [gpu:5]/GPUMemoryTransferRateOffset[3]=1400



#set power limits

sudo nvidia-smi -i 0 -pl 90

sudo nvidia-smi -i 1 -pl 90

sudo nvidia-smi -i 2 -pl 90

sudo nvidia-smi -i 3 -pl 90

sudo nvidia-smi -i 4 -pl 90

sudo nvidia-smi -i 5 -pl 90

The nvidia settings shell script works correctly when I run it via command line.  When I run it via systemd it does not work.
here is the journalctl output.


- Unit gputuner.service has finished shutting down.
Jun 05 01:44:13 archminer systemd[1]: gputuner.service: Start request repeated too quickly.
Jun 05 01:44:13 archminer systemd[1]: gputuner.service: Failed with result 'exit-code'.
Jun 05 01:44:13 archminer systemd[1]: Failed to start Ethereum Miner Process.
-- Subject: Unit gputuner.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit gputuner.service has failed.
-- 
-- The result is RESULT.

I have tried a few different Types for the systemd service with no luck.

Any help is appreciated.  Thanks.

Last edited by kmsgli (2018-06-05 13:27:17)

Offline

#2 2018-06-05 06:48:53

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Systemd: Issue running Nvdia settings shell script on boot

Please edit your thread title to reflect your actual issue (if the current one shows up in a search result, it is effectively meaningless): https://wiki.archlinux.org/index.php/Co … ow_to_post


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-06-05 13:28:20

kmsgli
Member
Registered: 2015-08-15
Posts: 33

Re: Systemd: Issue running Nvdia settings shell script on boot

jasonwryan wrote:

Please edit your thread title to reflect your actual issue (if the current one shows up in a search result, it is effectively meaningless): https://wiki.archlinux.org/index.php/Co … ow_to_post

Sorry I was careful to try and post within the rules but I don't post on here much as my answer is usually found via search. Subject has been changed.

Offline

Board footer

Powered by FluxBB