Does anyone have the know-how to build a LiveCD (or USB) Linux distro to support GPU and ASIC/ANT mining? The GPU in question (for now) is a AMD Radeon 6970 (but might change in the future).
I'm looking for a series of steps to follow. Of course one of the steps would be to install drivers to support whatever GPU card I have in the PC.
Why? The PC is question is a Windows 7 desktop used throughout the day and cannot be modified to run bfgminer etc (ie. I cannot install software onto this machine). But I can boot a LiveCD or USB to do mining at night.
I'm not familiar with Linux (outside of following a few simple guides to install and compile bfgminer and cgminer from git on a VPS). I am very familiar with Windows. If I need to install Linux on a VirtualBox in order to create a LiveCD/USB then I'm comfortable doing this.
Any help greatly appreciated.
For what its worth, all my main mining machines run a Gentoo Linux booted off a 16GB USB. Works just fine. 3.10.0 is even in the portage tree, although you will need to ACCEPT_KEYWORD override to get the latest version. I took a few early notes when I was building software mirrored USBs, those are attached below (sorry they are a bit long):
Bitminer install notes
Base Gentoo install (I’m using two 16GB USB sticks - $10 each from Microcenter)
/* NOTE: These are NOT complete instruction, view the details below. MANY steps are skipped, like chrooting – they presume you have done this before and are just looking for the key hints */
http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml – if you have done it before, and just want a checklist. I’m mirroring the two USB sticks in case one dies…
http://www.gentoo.org – and read the docs if you have never done a gentoo install before
USB Stick layout: gentoo1 / # fdisk -l /dev/sdb
Disk /dev/sdb: 15.5 GB, 15504900096 bytes, 30283008 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0570d639
Device Boot Start End Blocks Id System
/dev/sdb1 2048 264191 131072 fd Linux raid autodetect
/dev/sdb2 264192 4458495 2097152 82 Linux swap / Solaris
/dev/sdb3 4458496 4982783 262144 fd Linux raid autodetect
/dev/sdb4 4982784 30283007 12650112 fd Linux raid autodetect
gentoo1 / # vgs
VG #PV #LV #SN Attr VSize VFree
vg1 1 4 0 wz--n- 12.05g 3.05g
gentoo1 / # lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
home vg1 -wi-ao---- 1.00g
opt vg1 -wi-ao---- 2.00g
portage vg1 -wi-ao---- 2.00g
usr vg1 -wi-ao---- 4.00g
var vg1 -wi-ao---- 2.00g
gentoo1 / # cat /etc/fstab
# /etc/fstab: static file system information.
#
#
/dev/md1 /boot ext3 noauto,noatime 1 2
/dev/md3 / ext4 noatime 0 1
/dev/sda2 none swap sw 0 0
/dev/sdb2 none swap sw 0 0
/dev/vg1/usr /usr ext4 noatime,ro 1 2
/dev/vg1/portage /usr/portage ext4 noatime 1 2
/dev/vg1/home /home ext4 noatime 1 2
/dev/vg1/var /var ext4 noatime 1 2
/dev/vg1/opt /opt ext4 noatime 1 2
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
10.XX.YY.ZZ:/usr/portage/distfiles /usr/portage/distfiles nfs defaults 0 0
tmp /tmp tmpfs nodev,nosuid,noexec 0 0
vartmp /var/tmp tmpfs nodev,nosuid,size=4g 0 0
(Note: I have a common distfiles NFS share I use across my home network)
Emerge syslog-ng – basic Unix logging tool
Emerge vim – because I much prefer VI to Nano as an editor (learn VI once and you will have a basic editor on every Unix machine in the world)
Emerge gentoo-sources – for building your custom kernel
Major kernel item needed for Antminer (suggest building into kernel, not as modules)
Device Drivers -> USB Support -> USB Serial Converter Support -> USB CP210x family of UART Bridge Controllers
Emerge lvm2 mdadm – for support of logical volumes and raiding (not needed if you do a standard install without LVM or mirroring of course)
Emerge genkernel – don’t like it, but initramfs bootstrapping is just the way of the world these days
mdadm --detail –scan >> /etc/mdadm.conf
vi /etc/mdadm.conf and make sure the devices are called what you want them to be. E.g. /dev/md3 not /dev/gentoo:3 or something similar
genkernel –lvm –mdadm –mdadm-config=/etc/mdadm.conf –install initramfs
Emerge nfsutils – if you are going to use NFS, like I do for my distfiles area
emerge bfgminer (if you are not going to use your graphics card
/* Switch to the current Gentoo documentation for installing the newer Grub code if your using the LVM guide. I like the legacy Grub, because I know it, but the new one seems to work, so it’s probably good to go with the times… */
/* For any old Gentoo users just coming back:
The amd64 documentation is now for all 64 bit intel/amd folks.
Eth0 will not exist unless you “touch /etc/udev/rules.d 80-net-name-slot.rules”, which will force the traditional behavior. I find the traditional behavior just fine when you only have 1 Ethernet card… */
Emerge grub
grub2-install /dev/sda – first mirror device
grub2-install /dev/sdb – second mirror device
vi /etc/default/grub and uncomment GRUB_DISABLE_LINUX_UUID /* I had problems getting my usb sticks to boot, this helped, but it ended up around me wanting to specify the name of my md devices I also had to add “domdadm” to the kernel parameter line */
grub2-mkconfig –o /boot/grub/grub.cfg
emerge dev-vcs/git
cd /opt (or wherever you want to store the latest bfgminer tree)
git clone https://github.com/nwoolls/bfgminer/ -b feature/antminer-u1-support
cd bfgminer
./autogen.sh
./configure
/* Fix anything missing required by newer bfgminer than the standard one in the portage tree */
emerge uthash
./configure
make
Create a startup script and place in /etc/local.d looking something like:
#!/bin/bash
# set the worker name and password for your mining pool
WORKER="Cassey_Jean_Claude_gentoo1ant"
PASS="pass"
# see cgminer and bfgminer readme for details, choose one
#OPTS="-S opencl:auto --gpu-fan 100 --auto-gpu --intensity 14 --temp-overheat 90 --temp-cutoff 100 --temp-target 80 --verbose"
OPTS="-S antminer:all --set-device antminer.freq=0781"
# enter pool URLS in format URL:port
URL1="stratum+tcp://us1.eclipsemc.com:3333"
URL2="stratum+tcp://us2.eclipsemc.com:3333"
URL3="stratum+tcp://us3.eclipsemc.com:3333"
# get full path to miner, uncomment the miner you want
# CMD=`which cgminer`
CMD="./bfgminer"
# formart worker strings
S1="-o $URL1 -O $WORKER":"$PASS"
S2="-o $URL2 -O $WORKER":"$PASS"
S3="-o $URL3 -O $WORKER":"$PASS"
# concatenate command to run
RUN="$CMD $OPTS $S1 $S2 $S3"
echo "Changing to /opt/bfgminer"
cd /opt/bfgminer
rm *.bin
echo "$RUN"
$RUN
Of course, feel free to run EXACTLY that script. Doing so will credit me with ALL your efforts . Ok, ok, it should be obvious, but change the worker ids to your own…
Test your script!
cp /etc/local.d/mineart.start .
./mineart.start
With a bit of luck you should see bfgminer startup, see your AMU’s and rapidly start seeing them process data.
If you wish to use your graphics card, just do a:
ACCEPT_KEYWORDS=”~amd64” emerge bfgminer /* fetch the standard code */
Note will with fetch a LOT of X11 stuff, but it will still easily fit on the 16GB USB setup.
And create a new startup deck. You will want an OPTS line along the lines of:
OPTS="-S opencl:auto --gpu-fan 100 --auto-gpu --intensity 14 --temp-overheat 90 --temp-cutoff 100 --temp-target 80"
Personally… your probably better off emerging boinc and letting it use your space CPU and graphics card. Join the World Community Grid project, add yourself to the “Friends of Kevin” team , and let your space cycles go to the good of humanity. World Community Grid often runs programs that help discover cures for all kinds of things from malaria to aids to …
Or… proceed to use your CPU and GPU for litecoins…
To do this, I created a new /bitcoin and /litecoin lvm partition (512M is more than plenty). I copied the old /opt stuff over to /bitcoin and removed /opt from the system (freeing up 2GB!). This provides us two places to have different bfgminer builds. Of course, the startup scripts were changed to reflect this.
First we need a version of bfgminer with scrypt support
git clone https://github.com/luke-jr/bfgminer.git
cd bfgminer
./autogen.sh
./configure –enable-cpumining –enable-scrypt –enable-opencl
If you try and run it now, it should start, but not find any devices. That is because we don’t have the opencl libraries…
Now for the pain, at least for those liking a nice clean gentoo build:
We need opencl – this will suck in a ton of X windows stuff, but alas, I haven’t found a way around this. I suspect there are some other dependencies, so given we are trashing our clean distribution:
Edit /etc/portage/make.conf and remove the “-X” if you had it in there.
ACCEPT_KEYWORDS=”~amd64” emerge –u –newuse bfgminer”
Emerge ati-drivers
Emerge amd-adl-sdk
Emerge pciutils (will help figuring out your video card)
A good reference here, I won’t repeat it all.
http://gentoovps.net/setup-bitcoin-mining-gentoo-linux/
Don’t forget to set VIDEO_CARDS="fglrx vesa" in /etc/portage/make.conf