Author Topic: Mining Litecoin with cgminer and BAMT 0.5c  (Read 28721 times)

Offline Brun

  • Jr. Member
  • **
  • Posts: 115
Mining Litecoin with cgminer and BAMT 0.5c
« on: September 24, 2012, 12:36:30 AM »
This guide was written on September 24, 2012 and can be outdated. It was back in an era where Litecoin was selling for 0.03$USD, cgminer had just released Scrypt support and there was no stratum pools. Please take that into consideration while using this guide.

Update by viperware: https://forum.litecoin.net/index.php/topic,651.msg25709.html#msg25709

Hi there,

I've been working on this for a couple of days now, trying to find the best way to mine Litecoin using cgminer in BAMT 0.5c. For information, I own 21 rigs with around 75 GPU, so I needed to find an easy way to adapt my farm.

Useful topics:
cgminer: https://bitcointalk.org/index.php?topic=28402.0
BAMT: https://bitcointalk.org/index.php?topic=65915.0
cgminer bounty (contains a couple of troubleshooting solutions): https://bitcointalk.org/index.php?topic=92887.0
Some workaround and fix for BAMT: http://www.bitcointrading.com/forum/linux-distros/bamt-version-0-5-easy-usb-based-mining-linux-with-farm-wide-management-tools/msg1835/#msg1835

This guide is useful to get started, but there's some details that I want to specify:
http://www.bitcointrading.com/forum/linux-distros/bamt-version-0-5-easy-usb-based-mining-linux-with-farm-wide-management-tools/msg1835/#msg1835

-Don't git clone cgminer. DO NOT use the 2.7.x version of cgminer. I've used cgminer 2.6.4 and had no problems. 2.7+ has some issues with BAMT (like really low hashrate). You can download old version of cgminer here:
http://ck.kolivas.org/apps/cgminer/
-Compile a fresh version in BAMT, and replace the old cgminer for the new one.
-Sadly, you can't use BAMT "mother", you need to start cgminer manually and restart it manually(like with a script of your own). Using BAMT automatic functions seem to crash cgminer every 2 minutes.
-You can use config files for scrypt mining, here's an example of mine:
http://forum.litecoin.net/index.php/topic,639.0.html
-Many BAMTers know about it now, but if you unplug a monitor while BAMT is running, BAMT crash completely. If you used a monitor to configure your rig, restart the rig and unplug the monitor before BAMT is fully booted. I want to specify it because it's a maddening bug when you don't know about it.
-Using the current SDK and Radeon driver in BAMT seem to cause no major performance problems. Trying to install another SDK or another driver usually give only more trouble and instability with the system.
-ALWAYS enter the following commands before using cgminer when you boot the computer:
Code: [Select]
export DISPLAY=:0
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
If you don't use those commands, cgminer will spam you with tons of HW errors.

-For a custom auto-boot, I use this method:
*Go to /home/user
*Ctrl + H
*Open .config
*Create a folder "autostart" and go into it
*Create a file named "auto.desktop" and edit it with this:
Code: [Select]
[Desktop Entry]
Encoding=UTF-8
Name=coin
Exec=lxterminal --command "sh /home/user/myboot.sh"
Terminal=true

*Go back to /home/user and create the file "myboot.sh" (or whatever you name it).
Here's my file for example:
Code: [Select]
#!/bin/bash

sudo mount 192.168.xxx.xxx:/remote/mining/folder /mnt/nfs/mining

sleep 30
sudo /etc/init.d/mine stop
export DISPLAY=:0
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
cd /opt/miners/cgminer
./cgminer --config /mnt/nfs/mining/config/thisrig.conf

I'm using NFS file system for remote management of my files. If you want to use it, install this:
Code: [Select]
sudo apt-get install nfs-common
The sleep 30 is to give enough time for BAMT to boot. The
Code: [Select]
sudo /etc/init.d/mine stop is to be sure that BAMT doesn't start mining automatically, since you don't want two instances of cgminer doing Scrypt mining at the same time (it's a crash, I guarantee you :) )

If you want the nice little graphs of BAMT, edit the bamt.conf file. I've used the following lines at the main config section:
Code: [Select]
miner_id: mycomputer!
miner_loc: mom's basement!
cgminer: 1
do_cgsnoop: 1
And for each card:
Code: [Select]
disabled: 0
cgminer: 1

And remove all the kernel/pool settings. Keep all the settings starting with "monitor". The "monitors" settings are used for the nice little graphs. All the overclock options or pools settings are for phoenix only, and you don't care about that.

So, here you go, I hope it can help some around here. I can answer to some questions, but I'm not a BAMT or Linux expert. I just wanted to add more information because there's almost nothing for Litecoin mining, especially for non-Windows miners.
« Last Edit: May 19, 2013, 08:24:58 PM by Brun »

Offline AJM

  • Jr. Member
  • **
  • Posts: 69
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #1 on: September 24, 2012, 05:07:23 PM »
Great information. Thank you for posting and sharing.

Offline DiCE1904

  • Full Member
  • ***
  • Donator
  • ***
  • Posts: 444
  • legit
    • LTCDice
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #2 on: December 05, 2012, 12:19:07 AM »
this is excellent! Its going to take me a little bit to figure out, but thanks again!

Offline Brun

  • Jr. Member
  • **
  • Posts: 115
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #3 on: December 05, 2012, 06:04:17 AM »
this is excellent! Its going to take me a little bit to figure out, but thanks again!

Yeah, it's tricky because BAMT has not been made for LTC mining. Version 0.6 is supposed to come out soon, maybe it's going to be better.

Offline DiCE1904

  • Full Member
  • ***
  • Donator
  • ***
  • Posts: 444
  • legit
    • LTCDice
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #4 on: December 07, 2012, 07:39:37 PM »
I have been having some problems with the cgminer that installs using the tut, 2.6.1  to get 2.6.4 do I follow these instructions:

http://www.bitcointrading.com/forum/linux-distros/bamt-version-0-5-easy-usb-based-mining-linux-with-farm-wide-management-tools/msg1512/#msg1512

but switch
Quote
git clone https://github.com/ckolivas/cgminer.git


with: 
Quote
wget http://ck.kolivas.org/apps/cgminer/2.6/cgminer-2.6.4.tar.bz2
                    tar xvfj cgminer-2.6.4.tar.bz2

?


I tried just dragging and dropping the 2.6.4 files into the cgminer folder, but it said I didnt have permission  :-[
« Last Edit: December 07, 2012, 07:43:17 PM by DiCE1904 »

Offline CoinHoarder

  • Sr. Member
  • ****
  • Posts: 509
  • In Cryptocoins I Trust
    • CryptoVest
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #5 on: December 07, 2012, 07:51:51 PM »
mc_lovin aka maplesyrupghost is a boss!!  ;D  That bamt lite coin guide helped me convert all my rigs in about 5 minute each from a fresh bamt image on USB.

Follow the directions exactly as they are in the LTC post, I had a 9/9 success rate with my farm using that guide.

It's definitely the easiest way to mine LTC in Linux.  ;D

hint:
Go directly to the lite coin post, skip everything else. Then follow the instructions! He put most of the install into a shell script, so it's as easy as entering a few commands (which you copy and paste out of iceweasel).

PS: I haven't seen this before Brun, very nice. Thanks for the automation stuff :)
« Last Edit: December 07, 2012, 07:59:25 PM by CoinHoarder »
CryptoVest Physical Litecoins: https://cryptovest.com PGP Key: https://cryptovest.com/40F0E7A9D5FBE20F16DE80E86879AC0985C71E7C.asc
Smart Hashing (Gridseed ASICs & Accessories): https://smarthashing.us

Offline DiCE1904

  • Full Member
  • ***
  • Donator
  • ***
  • Posts: 444
  • legit
    • LTCDice
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #6 on: December 07, 2012, 08:05:57 PM »
mc_lovin aka maplesyrupghost is a boss!!  ;D  That bamt lite coin guide helped me convert all my rigs in about 5 minute each from a fresh bamt image on USB.

Follow the directions exactly as they are in the LTC post, I had a 9/9 success rate with my farm using that guide.

It's definitely the easiest way to mine LTC in Linux.  ;D

hint:
Go directly to the lite coin post, skip everything else. Then follow the instructions! He put most of the install into a shell script, so it's as easy as entering a few commands (which you copy and paste out of iceweasel).

PS: I haven't seen this before Brun, very nice. Thanks for the automation stuff :)

damn ok, ill make a new USB and try it again. I was having a problem with my cgminer config. It would either freeze my desktop with my GPUs going insane, or it would load cgminer and say it couldnt read my config.  >:(

still interested in updating cgminer on BAMT
« Last Edit: December 07, 2012, 08:13:13 PM by DiCE1904 »

Offline Brun

  • Jr. Member
  • **
  • Posts: 115
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #7 on: December 07, 2012, 08:28:48 PM »
Just a couple of points:
- config files are a bitch with Scrypt. I don't know why, but it seems to be a source of bugs. I had a couple of problems with these, so instead I've simply made shell script files that contains the execution of cgminer. Similar to that:
Code: [Select]
#!/bin/bash

export Display
export gpu sync thing
export max alloc percent something

cd /my/path/to/cgminer
./cgminer -o http://mypool:8332 -u me -p secure --rest of the options, don't forget scrypt


As for replacing the BAMT cgminer with 2.6.4, I do it this way:
-I download cgminer 2.6.4 in BAMT
-Compile cgminer 2.6.4 with scrypt option enabled with the correct path for the AMD SDK include/CL and /lib/. Similar to that:
Code: [Select]
CFLAGS="-O2 -Wall -march=native -I<path to AMD APP include>" LDFLAGS="-L<path to AMD APP lib/x86_64>" ./configure --enable-scrypt
make
-After that, I copy the content of my cgminer 2.6.4 folder into BAMT cgminer folder. There is some file change between 2.3.5 and 2.6.4, and instead of trying to find them, I just copy the whole thing.
-Don't use cgminer with BAMT directly, it seems to crash randomly. Start it yourself, with your own automatic boot.

If you want to use the file manager, you cannot use the file manager in the menu, because you will lack the admin access. Instead, open a terminal and type this:
Code: [Select]
sudo pcmanfm

It will open a file manager with admin access.

Hopes it help.

Offline debianlinux

  • Full Member
  • ***
  • Posts: 297
  • Freow
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #8 on: January 09, 2013, 02:06:10 PM »
Let me preface by saying that I have yet to install or run BAMT. That said, with all the trouble and bitchiness I'm reading why, exactly, are you bothering with BAMT instead of some other minimal USB bootable distro?

Offline DiCE1904

  • Full Member
  • ***
  • Donator
  • ***
  • Posts: 444
  • legit
    • LTCDice
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #9 on: January 10, 2013, 02:15:41 AM »
Let me preface by saying that I have yet to install or run BAMT. That said, with all the trouble and bitchiness I'm reading why, exactly, are you bothering with BAMT instead of some other minimal USB bootable distro?

there has actually been some improvements to the BAMT litecoin project that has made things MUCH easier

Offline debianlinux

  • Full Member
  • ***
  • Posts: 297
  • Freow
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #10 on: January 10, 2013, 02:33:38 PM »
there has actually been some improvements to the BAMT litecoin project that has made things MUCH easier

Can you point me to some resources? All I currently have is a BAMT 0.5c image and a handful of threads on how to work around the bitchiness.


Offline debianlinux

  • Full Member
  • ***
  • Posts: 297
  • Freow
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #12 on: January 11, 2013, 09:02:48 PM »
Followed that guide mostly to the Tee (not having network disconnect issue so omitted that part).

A few issues:

Mainly, I get a shitty low hashrate, 120k avg on a 5770 which using the typical settings found throughout should be hitting around 200k.
Also, if I make any changes to bamt.conf (specifically enabling my gpu) mother faults me for not mining and I get an eyestraining red background.

I'm currently questioning the legitimacy of updating cgminer to 2.10.4 and updating the ATI driver to 12.10.

I'm also trying to get my head around how exactly bamt and cgminer relate to one another. If I leave bamt.conf at stock (gpu disabled) and manually run cgminer I should be assured that the arguments passed at the command line are the only affects on my miner, yes?

Offline Brun

  • Jr. Member
  • **
  • Posts: 115
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #13 on: January 16, 2013, 04:32:55 AM »
Let me preface by saying that I have yet to install or run BAMT. That said, with all the trouble and bitchiness I'm reading why, exactly, are you bothering with BAMT instead of some other minimal USB bootable distro?

I like the little graphs  ;D And I'm used to it, I don't really have to mess with drivers and whatever, it get the job done when you know how to deal with the little problems.

Followed that guide mostly to the Tee (not having network disconnect issue so omitted that part).

A few issues:

Mainly, I get a shitty low hashrate, 120k avg on a 5770 which using the typical settings found throughout should be hitting around 200k.
Also, if I make any changes to bamt.conf (specifically enabling my gpu) mother faults me for not mining and I get an eyestraining red background.

I'm currently questioning the legitimacy of updating cgminer to 2.10.4 and updating the ATI driver to 12.10.

I'm also trying to get my head around how exactly bamt and cgminer relate to one another. If I leave bamt.conf at stock (gpu disabled) and manually run cgminer I should be assured that the arguments passed at the command line are the only affects on my miner, yes?

Getting "optimal" hashrate is a mess with Litecoin. I'm still baffled at how sometimes, there is really no logic between the settings and the hashrate. With the 5770s and 6770s I own, I was able to have the hashrate to jump from around 125 khash to around 150 khash by underclocking the GPU. Don't know why, but 740 mhz for the gpu and 1000 mhz for the memory was pretty efficient.

Litecoin mining is about finding a balance between the processor and the memory clock. But since there's so many configuration possible, there is a lot of variables that could affect the hashrate. The community is still small, so the data available is pretty slim too.

Bamt.conf is pretty much optional. I use it for the web interface, so I can connect easily and see the status of my GPU, but you can bypass it completely. The automatic(start, stop) functions of BAMT don't seem to work that well with new versions of cgminer, especially with Litecoin.

As for the different versions, well, go ahead if you want to try it. I wanted to give people a version of cgminer that worked (2.6.4) so they don't lose their time looking for one. I lost two days with that 2.7.x version that couldn't do shit (as it was the most recent one back when I wrote my first post).

The relation between BAMT and cgminer is pretty simple. BAMT is a OS bundled with mining helpers. You can run standard stuff without messing with BAMT, since it's still a OS. If you use the bamt.conf, it creates the link between cgminer and BAMT, so you can use the different helpers that BAMT provide. I like the web interface, it makes my farm easy to manage, so I've configured BAMT for it. But you're not forced to use BAMT helpers, especially since BAMT was build with Phoenix in mind, not cgminer. Cgminer was added later, probably because gigavps paid for it being included.

You can manually run cgminer without messing with BAMT, don't worry about it.

I hope it helps you!

Offline kupo2001

  • Newbie
  • *
  • Posts: 8
Re: Mining Litecoin with cgminer and BAMT 0.5c
« Reply #14 on: March 17, 2013, 11:59:49 PM »
Please Help. I have 2 questions.

Question #1)
I have a MSI z77a-g45 Motherboard with intel i3. I have 6 ATI 7950's. I have gotten 4 cards to work in cgminer but when I add the 5th card the BAMT loader comes up as normal but after it loads it never gets to the GUI just stays a black screen. I have tried ssh session from my laptop and it just gives me time out. I can connect through ssh with 4 cards connected. So at some point in time BAMT is locking up. I have 8gb of ddr3 ram on the motherboard.  Please help I know i have heard of and seen pictures of people using 5 or 6 ATI cards on 1 motherboard.

Question #2)
Ok so when I am in BAMT0.5 running cgminer with a config file my cards are pulling around 600-640 each but i get a 200-300% stale rate with the pool i join..... but when I use the same 4 cards in win7 i connect to the same pool and get about 600-620per card but i only get 5% stale rate. What is causing this problem? I would prefer using BAMT. <---- Because Linux is better :-D

I would greatly appreciate anyone's help. I have been stuck on this problem for a while now :-(