Tag
Hash :
b2e15e49
Author :
Date :
2012-01-22T00:06:31
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
How to setup a cgminer using xubuntu 11.04 live on a USB
The master version of this document is here:
https://github.com/kanoi/linux-usb-cgminer
The actual file is:
https://github.com/kanoi/linux-usb-cgminer/blob/master/linux-usb-cgminer
The copy in cgminer (check to make sure it isn't older) is:
https://github.com/ckolivas/cgminer/blob/master/linux-usb-cgminer
The original old verion on bitcointalk is:
https://bitcointalk.org/index.php?topic=28402.msg426741#msg426741
========
I have said to select English for the install process for 2 reasons:
1) I don't know any other spoken language very well
and
2) I'm not sure what problems installing under a different language
might cause (it will probably cause no problems but I don't know)
Software
========
Short hardware comment:
Your mining computer doesn't need any HDD or CD/DVD/BD as long as it has at
least 2GB of RAM, can boot USB, has some network connection to the internet
and of course a reasonable mining ATI graphics card
... Or you can boot a windows PC with the USB to only do mining ... and ignore
the system HDD ... wasting energy running the HDD (roughly 10 Watts per HDD) :)
If you wish to install to an HDD instead of a USB,
see the changes to the instructions at the end
To create the USB, you need of course a 4GB USB and temporarily need a PC
with a CD (or DVD/BD) writer, a USB port and of course an internet
connection to the PC
1) Download the xubuntu 11.04 desktop live CD iso for amd64
( look here for mirrors: http://www.xubuntu.org/getubuntu )
2) Burn it to CD then boot that temporarily on any PC with a CD/DVD/BD and
a USB port (this and the next 2 step won't effect that PC)
Select "English" then select "Try Xubuntu without installing"
and wait for the desktop to appear
(this happens by default if you wait for the timeouts)
3) Plug in your 4GB USB device and it should appear on the desktop - you can
leave it's contents as long as there is at least 2.8GB free
4) Now run "Startup Disk Creator" in "Applications->System"
(the system menu is the little rat in the top left corner)
(if you have no mouse you can get the menu with <ctr><esc> and navigate
the menu with the arrow keys and <return> key)
From here select the boot CD as the "Source" and the USB as the "Disk to use"
lastly move the slider to 2GB for reserved extra space
The 2GB should be enough for modifications
Click: "Make Install Disk"
After about 10-15 minutes you have a base xubuntu 11.04 boot USB
(you can shut down this computer now)
5) Boot your cgminer PC with this USB stick, select "English"
then select "Try Xubuntu without installing" and wait for the desktop to
appear (this happens by default if you wait for the timeouts)
6) Start a terminal
"Applications->Accessories->Terminal Emulator"
7) sudo apt-get install openssh-server screen
if you have a problem here then it's probably coz the internet isn't
available ... sort that out by reading elsewhere about routers etc
8) sudo apt-get install fglrx fglrx-amdcccle fglrx-dev
sudo sync
sudo shutdown -r now
N.B. always do a "sudo sync" and wait for it to finish every time before
shutting down the PC to ensure all data is written to the USB
9) sudo aticonfig --lsa
this lists your ATI cards so you can see them
sudo aticonfig --adapter=all --odgt
this checks it can access all the cards ...
10) sudo aticonfig --adapter=all --initial
this gets an error - no idea why but the xorg.conf is OK
sudo sync
sudo shutdown -r now
11) sudo aticonfig --adapter=all --odgt
this checks it can access all the cards ...
12) get AMD-APP-SDK-v2.4-lnx64.tgz from
http://developer.amd.com/sdks/amdappsdk/downloads/pages/default.aspx
( http://developer.amd.com/Downloads/AMD-APP-SDK-v2.4-lnx64.tgz )
sudo su
cd /opt
(replace /home/ubuntu/ with wherever you put the file: )
tar -xvzf /home/ubuntu/AMD-APP-SDK-v2.4-lnx64.tgz
cd AMD-APP-SDK-v2.4-lnx64/
cp -pv lib/x86_64/* /usr/lib/
rsync -avl include/CL/ /usr/include/CL/
tar -xvzf icd-registration.tgz
rsync -avl etc/OpenCL/ /etc/OpenCL/
ldconfig
sync
shutdown -r now
You now have an OpenCL enabled xubuntu
13) cgminer:
sudo apt-get install curl
get the binary linux cgminer
(see the bitcoin forum cgminer thread for where to get it)
https://bitcointalk.org/index.php?topic=28402.0
./cgminer -n
this shows you the GPU's it found on your PC
See further below if you get an error regarding libtinfo.so.5
14) An OC option:
This is no longer needed since cgminer 2.* includes OC, however:
sudo apt-get install libwxbase2.8-0 libwxgtk2.8-0
http://sourceforge.net/projects/amdovdrvctrl/
for an Over/underclocking application and get the file listed below then:
sudo dpkg -i amdoverdrivectrl_1.2.1_amd64.deb
15) set the screen saver to ONLY blank ...
Move the mouse to the bottom of the screen and you see a set of icons like
on an Apple PC
Click on Settings, then in the Settings window "Screensaver"
Set "Mode:" to "Blank Screen Only"
16) apt-get install ntpd
An accurate clock is always a good idea :)
17) if you wish to ssh into the box you must set a password
to do this you simply have to be logged into it at the screen and type
sudo passwd ubuntu
it will prompt you (twice) to enter a password for the ubuntu account
Initial setup complete.
========
If you want to SSH into the machine and run cgminer:
From a terminal on the miner display each time after you boot:
xhost +
'xhost +' isn't needed if you ssh into the machine with the same
username that the GUI boots into (which is 'ubuntu' in this case)
Then after you ssh into the machine:
export DISPLAY=:0
before running cgminer
Also note, that you should force the screen to blank when mining if
the ATI card is displaying the screen (using the screen saver
application menu)
In my case it takes away 50Mh/s when the screen isn't blanked
It will auto blank - but make sure the blank is of course just blank
as mentioned above at 15)
This is of course just the basics ... but it should get you a computer
up and running and able to run cgminer
========
You should keep an eye on USB disk space
The system logger writes log files in the /var/log/ directory
The two main ones that grow large are 'kern.log' and 'syslog'
If you want to keep them, save them away to some other computer
When space is low, just delete them e.g.
sudo rm -i /var/log/syslog
sudo rm -i /var/log/kern.log
The 'df' command will show you the current space e.g.:
sudo df
Filesystem 1K-blocks Used Available Use% Mounted on
aufs 2099420 892024 1100748 45% /
none 1015720 628 1015092 1% /dev
/dev/sda1 3909348 2837248 1072100 73% /cdrom
/dev/loop0 670848 670848 0 100% /rofs
none 1023772 136 1023636 1% /dev/shm
tmpfs 1023772 16 1023756 1% /tmp
none 1023772 124 1023648 1% /var/run
none 1023772 0 1023772 0% /var/lock
This shows the 2GB space allocated when you setup the USB as '/' (aufs)
In this example, it's currently 45% full with almost 1.1GB of free space
========
The latest version (2.0.8) of cgminer is built with 11.10 (not 11.04)
If you get the following error when running the prebuilt version in 11.04:
./cgminer: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
The fix is to simply link the old curses library to the new name e.g.:
cd /lib64/
sudo ln -s libncurses.so.5 libtinfo.so.5
========
If you wish to install to an HDD instead of a USB:
--------------------------------------------------
As per before:
1) Download the xubuntu 11.04 desktop live CD iso for amd64
( look here for mirrors: http://www.xubuntu.org/getubuntu )
Then:
2) Burn it to CD then boot that on your new mining PC
Select "English" then select "Install Xubuntu"
(you have 30 seconds to do this)
3) When the Install window comes up - again select "English" and click "Forward"
4) The next page will show you if you meet certain install requirements
(make sure you do meet them all)
Don't select the download option
The 3rd party option isn't needed for mining so ignore that also
Click "Forward"
5) With "Allocate drive space" it's probably easiest to say to use the
"Erase" option.
This is just for mining right? :)
However, if you have anything on the HDD that you want to keep - the
"Erase" install process will delete it - so back it up (quit the install)
Also make sure there are no OTHER HDD attached that it may erase also
i.e. only have attached the one HDD that you want to install onto unless
you know exactly what you are doing
If you see the "Install Xubuntu 11.04 alongside 'something'" then that
just means that the HDD wasn't blank.
If you want to try this option - do that yourself and then skip to step
7) below when you get to that.
There are plenty of other options available if you select "Something else"
but I'm not going to go into all the details here other than to say that
my preferred partioning is: /boot = 1GB = ext2, swap = twice memory size,
/ = 100GB = ext3 and the rest: /extra = ext3
Click "Forward"
6) If you selected "Erase" then it allows you to choose the drive to install to
Then click "Install Now"
7) "Where are you?" sort that out then click "Forward"
8) "Keyboard layout" sort that out (use the default) then click "Forward"
9) "Who are you?" The important one here is "Pick a username:" coz that's
the name you will need to ssh into, to access it remotely (and of course
the "Choose a Password" you set)
If you set the "username" to anything but "ubuntu" then: wherever in this
document I have mentioned the username "ubuntu" you must of course use the
username you chose here instead of "ubuntu"
Important: set it to "log in automatically" if you ever want to be able
to start cgminer without being in front of the computer since 'X' must
be running to use cgminer properly
That does of course mean that the computer isn't secure from anyone who
has access to it - but then again no computer that can automatically
reboot is secure from anyone who has access to the actual computer itself
Then click "Forward"
10) Of course when it completes click on "Restart Now"
... and remove the Xubuntu CD when it asks you
11) Wait for it to finish rebooting ... and it will auto login
(unless you didn't do step 9) "Important:")
12) After it logs in, an upgrade popup for 11.10 (or later) will appear
Select "Don't Upgrade"
13) Now go to step 6) of the USB script above for what to do next and that
covers everything else needed