Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: Zman0101 on September 17, 2011, 10:04:35 PM



Title: Install CGMiner on UBUNTU 11.4 x64
Post by: Zman0101 on September 17, 2011, 10:04:35 PM
Can anyone please help me install CGMINER 2.03 on Ubuntu 11.04. Im a noob on Linux. I couldn't stand my windows boxes crashing anymore. Thanks



Title: Re: Install CGMiner on UBUNTU 11.4 x64
Post by: gnar1ta$ on September 17, 2011, 10:27:02 PM
I just set one up a couple days ago.  Do you have any specific issues, or are you looking for a start to finish guide?


Title: Re: Install CGMiner on UBUNTU 11.4 x64
Post by: Zman0101 on September 17, 2011, 10:42:14 PM
start to finish guide.


Title: Re: Install CGMiner on UBUNTU 11.4 x64
Post by: gnar1ta$ on September 17, 2011, 11:44:41 PM
ok....I don't know how familiar you are with linux installs or command line, and I'm not a linux expert myself but I'll try anyway.

Ubuntu installation instructions can be found here:
http://www.ubuntu.com/download/ubuntu/download (http://www.ubuntu.com/download/ubuntu/download)

Basically, download iso, burn to CD, boot from CD, run installer.

Then you need open a terminal "Applications->Accessories->Terminal"

run these commands (you will need to enter your password)
Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libcurl4-openssl-dev libncurses5-dev lib32gcc1 libc6-i386 lib32gcc1 libc6-i386 dkms openssh-server screen

Install Catalyst 11.6 - reference here
http://mygeekopinions.blogspot.com/2011/06/how-to-install-atiamd-catalyst-linux.html (http://mygeekopinions.blogspot.com/2011/06/how-to-install-atiamd-catalyst-linux.html)

Code:
 cd ~/; mkdir catalyst11.6; cd catalyst11.6/
wget http://www2.ati.com/drivers/linux/ati-driver-installer-11-6-x86.x86_64.run
chmod +x ati-driver-installer-11-6-x86.x86_64.run
sudo sh ./ati-driver-installer-11-6-x86.x86_64.run --buildpkg Ubuntu/natty
sudo dpkg -i fglrx*.deb
If you get dependency problems after the last command run
Code:
sudo apt-get  -f install

Update X.org file
Code:
sudo DISPLAY=:0 aticonfig -f --initial --adapter=all

Reboot

Installation of SDK and CG can be found on github page
https://github.com/ckolivas/cgminer (https://github.com/ckolivas/cgminer)

Install SDK (2.4)
Go here

accept agreement and download, save file (default location).

 (http://developer.amd.com/membership/licenseagreement.aspx?id=39b7c439-12cc-471c-aa99-01de35df54e8&ReferUrl=http%3a%2f%2fdeveloper.amd.com%2fsdks%2fAMDAPPSDK%2fdownloads%2fpages%2fAMDAPPSDKDownloadArchive.aspx[/url)
Code:
sudo -s
cd /opt
tar xf ~/Downloads/AMD-APP-SDK-v2.4-lnx64.tgz
cd /
tar xf /opt/AMD-APP-SDK-v2.4-lnx64/icd-registration.tgz
ln -s /opt/AMD-APP-SDK-v2.4-lnx64/include/CL /usr/include
ln -s /opt/AMD-APP-SDK-v2.4-lnx64/lib/x86_64/* /usr/lib/
ldconfig
exit

Install CG
Code:
cd ~
wget http://ck.kolivas.org/apps/cgminer/cgminer-2.0.3.tar.bz2
sudo tar xvjf cgminer-2.0.3.tar.bz2

Do the following before configuring, (from readme in cgminer-2.0.3/ADL_SDK):
Please insert AMD ADL files adl_defines.h adl_sdk.h adl_structures.h here.
(http://developer.amd.com/gpu/adlsdk/Pages/default.aspx (http://developer.amd.com/gpu/adlsdk/Pages/default.aspx))
accept agreement and download, save file (default location)
Code:
cd ~/Downloads
unzip ADL_SDK_3.0.zip
sudo cp include/*.h ~/cgminer-2.0.3/ADL_SDK/

Then configure:
Code:
cd ~/cgminer-2.0.3/
CFLAGS="-O2 -Wall -march=native" ./configure
You should get this:
 OpenCL...............: FOUND. GPU mining support enabled
  ADL..................: SDK found, GPU monitoring support enabled
Then make:
Code:
make

Now you can run cgminer from the directory with
Code:
DISPLAY=:0 ./cgminer <options>

Or do the following
Code:
sudo cp cgminer /usr/bin
sudo cp *cl /usr/bin
this will let you run from any directory by just typing cgminer <options>
Just remember you need to set the DISPLAY variable for SDK support either by putting
Code:
DISPLAY=:0
before the cgminer command or
Code:
export DISPLAY=:0
then run the commands.

EDIT: I cleaned this up by testing on a fresh VM but I don't have any ATI cards on this machine to actually run the miner.  Let me know if you find any errors - it's late and beer makes it all look right to me.





Title: Re: Install CGMiner on UBUNTU 11.4 x64
Post by: gnar1ta$ on September 18, 2011, 05:12:38 PM
Just realized a much easier procedure, instead of compiling from source an easier way to install CG is using the Ubuntu bianary.
Code:
cd ~
wget http://ck.kolivas.org/apps/cgminer/cgminer-2.0.3-x86_64-built.tar.bz2
tar sxfv cgminer-2.0.3-x86_64-built.tar.bz2
cd cgminer-2.0.3
sudo mv cgminer /usr/bin
sudo mv *.cl /usr/bin

Now just start cg from any command line
Code:
DISPLAY=:0 cgminer <options>


This should probably be moved to mining??


Title: Re: Install CGMiner on UBUNTU 11.4 x64
Post by: CA Coins on September 18, 2011, 05:28:56 PM
From an earlier post:

Good walk-through on Ubuntu:  https://bitcointalk.org/index.php?topic=7514.0

I like BAMT if this is a dedicated machine.  Burn the image onto a USB stick.  Boot up, edit a few lines in the config file and it's ready to mine: https://bitcointalk.org/index.php?topic=28967.0


Title: Re: Install CGMiner on UBUNTU 11.4 x64
Post by: gnar1ta$ on September 18, 2011, 05:48:22 PM
From an earlier post:

Good walk-through on Ubuntu:  https://bitcointalk.org/index.php?topic=7514.0

I like BAMT if this is a dedicated machine.  Burn the image onto a USB stick.  Boot up, edit a few lines in the config file and it's ready to mine: https://bitcointalk.org/index.php?topic=28967.0

Inaba's guide is very good but cgminer 2 + has all clock and fan control built in, much simpler to use for linux noobs.  And BAMT is definitely the easiest for dedicated rigs, that's what I use on all but one rig.  I have one rig that won't run BAMT because of hardware issues and a crappy connection that cg handles much better than phoenix.

Here is a procedure for making cg run at startup:

Set auto login
System->Administration->Login Screen
Unlock, enter password, select Log in as xxxxx automatically, close

Create mine start script
open terminal
Code:
cd ~
sudo nano mine.sh

If you plan on connecting with ssh put this in file
Code:
#!/bin/sh

export DISPLAY=:0
xhost +
screen -d -m -S cgminer cgminer <options>
If you do not plan on connecting with ssh, this should work
Code:
#!/bin/sh

screen -d -m -S cgminer DISPLAY=:0 cgminer <options>

Ctrl x then y and enter to save

Make it executable
Code:
sudo chmod +x mine.sh

Now set the script to run at startup
System->Preferences->Startup Applications
Click add, enter a name and comment, for command - click Browse and select the mine.sh script you just created.  Click Add, and Close.
Reboot and test.  This should launch cg in a screen session.  To view the session
Code:
screen -r cgminer
To detach from the screen session Ctrl a then d


Title: Re: Install CGMiner on UBUNTU 11.4 x64
Post by: CA Coins on September 19, 2011, 05:36:45 AM
Great, thanks. I have yet to try CGminer but maybe I will check it out on my Ubuntu box. I have heard lots of good things about it.


Title: Re: Install CGMiner on UBUNTU 11.4 x64
Post by: Zman0101 on September 19, 2011, 03:05:50 PM
Thanks guys. I will give this a shot. I reformatted the one windows box that's giving me an issue and it works fine now with the new CGMiner but, i will set up a dual boot on the system and try it again. I wiped the whole hard drive last time and thought... oh this will be easy i can figure it out LOL. I got as far as getting linux installed. Loading the new Catalyst drivers and installing SDK. But i couldnt figure out the compiling of CG Miner.  Thanks for your help.