Bitcoin Forum
May 28, 2024, 09:52:23 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Headless Miner - cgminer issue (Ubuntu 12.04)  (Read 3727 times)
hayek (OP)
Sr. Member
****
Offline Offline

Activity: 370
Merit: 250


View Profile
June 09, 2013, 03:35:35 AM
 #1

I can connect a keyboard/mouse and boot the system to the desktop, start cgminer and everything works.

If I reboot and connect via ssh when I try to start cgminer it complains that no adapters are available.

Has anyone had this issue? Do I have to initialize X before starting cgminer?
os2sam
Legendary
*
Offline Offline

Activity: 3578
Merit: 1091


Think for yourself


View Profile
June 09, 2013, 04:18:24 AM
 #2

Funny thing about GPU's, they need a GUI.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
suryc
Sr. Member
****
Offline Offline

Activity: 298
Merit: 250


Play2Live pre-sale starts on January 25th


View Profile
June 09, 2013, 04:24:06 AM
 #3

Yes, X has to be running and you should run these two commands before you start cgminer via ssh:

export DISPLAY=:0
xhost +

.
PLAY
            ▄██████████████▄
          ▄██▀▀██████████████▄
        ▄██▀    ▀██████████████▄
      ▄██▀        ▀██████████████▄
    ▄██▀   ██████▄  ▀██████████████▄
  ▄██▀          ██    ▀██████████████▄
 ███       ▄█████▀      ███████████████
  ▀██▄    ▐██         ▄██████████████▀
    ▀██▄  ▐██████▌  ▄██████████████▀
      ▀██▄        ▄██████████████▀
        ▀██▄    ▄██████████████▀
          ▀██▄▄██████████████▀
            ▀██████████████▀
.
LIVE
.
██████
███▀▀▀
███







███
███▄▄▄
██████
██████
▀▀▀███
███







███
▄▄▄███
██████
suryc
Sr. Member
****
Offline Offline

Activity: 298
Merit: 250


Play2Live pre-sale starts on January 25th


View Profile
June 09, 2013, 04:41:45 AM
 #4

Another thing, if its going to be a headless miner, you should probably create some auto startup scripts. I use something like the below:

Create a file called mine.sh in your home directory containing something like this:
Code:
#!/bin/sh
export DISPLAY=:0
export GPU_MAX_ALLOC_PERCENT=100
export GPU_USE_SYNC_OBJECTS=1
cd /[** insert path to cgminer director **]
./cgminer -o [mining pool url] -u [username] -p [password] [*insert all your cgminer options*]

Create a file called launch_miner.sh in your home directory containing something like this:
Code:
#!/bin/bash
DEFAULT_DELAY=0
if [ "x$1" = "x" -o "x$1" = "xnone" ]; then
   DELAY=$DEFAULT_DELAY
else
   DELAY=$1
fi
sleep $DELAY
su YOUR_USERNAME -c "screen -dmS cgm /[*insert path to home directory*]/mine.sh"

make sure launch_miner.sh is executable (chmod +x launch_miner.sh)

Then you can make it run automatically at startup:
sudo nano /etc/rc.local
and add this line above the line that says "exit 0":
Code:
/[*insert path to home directory*]/launch_miner.sh 30 &

And, add an alias to make it easy to check on cgminer...
sudo nano .bashrc
and add this line above the last section (that starts with "# enable program completion...")
Code:
alias cgm='screen -x cgm'

If you do this, and have auto login enabled on the miner, then whenever it starts up it will automatically start mining after a 30 second delay. If you ssh in to it, all you have to do is use the command cgm and you will be able to see cgminer.
Another recommendation, go into the bios of the machine and turn on the automatic power on after power loss. That way if the machine ever loses power, it will automatically come back on and start mining again.

.
PLAY
            ▄██████████████▄
          ▄██▀▀██████████████▄
        ▄██▀    ▀██████████████▄
      ▄██▀        ▀██████████████▄
    ▄██▀   ██████▄  ▀██████████████▄
  ▄██▀          ██    ▀██████████████▄
 ███       ▄█████▀      ███████████████
  ▀██▄    ▐██         ▄██████████████▀
    ▀██▄  ▐██████▌  ▄██████████████▀
      ▀██▄        ▄██████████████▀
        ▀██▄    ▄██████████████▀
          ▀██▄▄██████████████▀
            ▀██████████████▀
.
LIVE
.
██████
███▀▀▀
███







███
███▄▄▄
██████
██████
▀▀▀███
███







███
▄▄▄███
██████
hayek (OP)
Sr. Member
****
Offline Offline

Activity: 370
Merit: 250


View Profile
June 09, 2013, 04:58:31 PM
 #5

Hey thanks for the serious answers. It helped out a lot, toss your BTC/LTC address my way for a tip
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!