Bitcoin Forum

Alternate cryptocurrencies => Mining (Altcoins) => Topic started by: moonmaths on February 20, 2017, 12:04:36 PM



Title: Linux: Reboot after Failed GPU's
Post by: moonmaths on February 20, 2017, 12:04:36 PM
Hoping some linux or screen guru can help here with rebooting when a GPU is sick/dead. 

I've got the options configured correctly for sgminer-gm to attempt the reboot after gpu-failure, but since I'm not running sgminer as sudo, the program spits out a permissions error. 
I'm using screen to create a new session, start the miner at every boot.  I only run into a problem when a GPU flunks out on me, and I'm new to linux, so still learning systemd.  Does anyone know the proper way to let sgminer reboot when it attempts to? 

I'm on Ubuntu 16.04 kernel 4.8.3-040803-generic amdgpu-pro-16.50

Here's the error (from within the miner)..

Thread 0 still exists, killing it off
Failed to set wall message, ignoring: Interactive authentication required.
Failed to reboot system via logind: Interactive authentication required.
Failed to start reboot.target: Interactive authentication required.
See system logs and 'systemctl status reboot.target' for details.
Failed to open /dev/initctl: Permission denied
Failed to talk to init daemon.

GPU0: Not responded for more than 10 minutes, declaring DEAD!
running shutdown -r now
Failed to set wall message, ignoring: Interactive authentication required.
Failed to reboot system via logind: Interactive authentication required.
Failed to start reboot.target: Interactive authentication required.
See system logs and 'systemctl status reboot.target' for details.
Failed to open /dev/initctl: Permission denied
Failed to talk to init daemon.


"systemctl status reboot.target" shows..
Code:
● reboot.target - Reboot
   Loaded: loaded (/lib/systemd/system/reboot.target; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd.special(7)

My systemd service to start up the miner (which works fine afaik) is the following:
Code:

[Unit]
Description=Monero GPU miner
After=network.target multi-user.target

[Service]
Type=forking
User=miner
Environment="DISPLAY=:0"
Environment="GPU_MAX_ALLOC_PERCENT=100"
Environment="GPU_USE_SYNC_OBJECTS=1"
WorkingDirectory=/home/kaminer/sgminer-gm/
ExecStart=/usr/bin/screen -d -m -S sgminer /usr/local/bin/sgminer
ExecStop=/usr/bin/killall -w -s 2 sgminer
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

I'm thinking I should be able to elevate priveleges for certain screen sessions or maybe make an alias for the reboot command within that session (so that I am only changing the priveleges within that single command w/in that single session) but am having a hard time figuring out how. 


Title: Re: Linux: Reboot after Failed GPU's
Post by: jk_14 on February 21, 2017, 03:12:06 AM

but since I'm not running sgminer as sudo, the program spits out a permissions error. 


run sgminer as root? :)


Title: Re: Linux: Reboot after Failed GPU's
Post by: galaxy5user on March 14, 2017, 12:35:11 PM
Is there any progress? How you been able to run sgminer in daemon mode? For me it starts only when stdin is bound to the terminal.


Title: Re: Linux: Reboot after Failed GPU's
Post by: skyvacrypto on February 02, 2018, 06:23:05 AM
ever figure this out? im trying to write something that restarts them automatically...but im running into this problem.


Title: Re: Linux: Reboot after Failed GPU's
Post by: moonmaths on February 19, 2018, 08:55:32 PM
I don't have that rig anymore, sorry. 
But if I remember correctly, I was using screen on the rig, and using a root user for screen (and thus sgminer), I sstopped the annoying errors, and it would reboot.  It probably wasn't the kosher way, but it got the job done.