您的位置:首页 > 运维架构 > Linux

How to: cgminer (Bitcoin, Litecoin etc.) + AMD Radeon driver install on CentOS

2015-06-28 13:16 567 查看
UPDATE 7/7/13: If you want to use Catalyst drivers version 12.8 you will find that X won’t start (error msg: /usr/lib/xorg/modules/drivers/fglrx_drv.so: undefined symbol: noXFree86DRIExtension) if you installed CentOS 6.4. Catalyst > 12.8 will work fine. To fix that, you can downgrade to the Xorg version that ships with CentOS 6.3:
yum --disablerepo=\* --enablerepo=C6.3\* downgrade xorg\*
(You may also need to do:
yum remove xorg-x11-drv-modesetting
)Do this before you install Catalyst!UPDATE END.Here’s my how-to for cgminer / AMD Radeon drivers under CentOS 6.4,32bit in this example. You can basically copy & paste every line andyou should end up with a working mining rig.Install required packages:
yum install wget system-config-firewall-tui openssh-clients
kernel-devel-2.6.32-358.el6.i686 libcurl-devel ncurses-devel
compat-libstdc++-33 screen xterm

yum groupinstall "X Window System" "Development tools"
Download and extract cgminer 3.7.2 – later versions don’t support GPU mining:
cd /root

wget http://ck.kolivas.org/apps/cgminer/3.7/cgminer-3.7.2.tar.bz2 
tar xjvf cgminer-3.7.2.tar.bz2
Download AMD APP and ADL SDKs for cgminer compilation from:AMD APP SDK: http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloadsAMD ADL SDK: http://developer.amd.com/tools-and-sdks/graphics-development/display-library-adl-sdkInstall AMD APP SDK:
cd /opt

tar xvzf /root/AMD-APP-SDK-v2.8-lnx32.tgz

cd /

tar xvzf /opt/icd-registration.tgz

cd /opt

tar xvzf AMD-APP-SDK-v2.8-RC-lnx32.tgz

ln -s /opt/AMD-APP-SDK-v2.8-RC-lnx32/include/CL /usr/include

ln -s /opt/AMD-APP-SDK-v2.8-RC-lnx32/lib/x86/* /usr/lib/
Install AMD ADL SDK:
cd /root

mkdir ADL

mv ADL_SDK_5.0.zip ADL

cd ADL

unzip ADL_SDK_5.0.zip

cp include/*.h /root/cgminer-3.7.2/ADL_SDK
Build cgminer for Litecoin (with scrypt support):
cd /root/cgminer-3.7.2

CFLAGS="-O2 -Wall -march=native
-I/opt/AMD-APP-SDK-v2.8-RC-lnx32/include"
LDFLAGS="-L/opt/AMD-APP-SDK-v2.8-RC-lnx32/lib/x86" ./configure
--enable-scrypt

make

make install
(if you want to run the cgminer binary from everywhere)Install fglrx AMD graphics card drivers:AMD Catalyst driver (fglrx) from: http://support.amd.com/us/gpudownload/linux/Pages/radeon_linux.aspx(e.g.
cd /root

wget http://www2.ati.com/drivers/linux/amd-catalyst-13.4-linux-x86.x86_64.zip[/code] )
unzip amd-catalyst-13.4-linux-x86.x86_64.zip

chmod 700 amd-catalyst-13.4-linux-x86.x86_64.run

./amd-catalyst-13.4-linux-x86.x86_64.run --buildpkg RedHat/RHEL6

rpm -Uvh fglrx_p_i_c-12.104-1.i386.rpm
reboot
amdconfig --adapter=all --initial
If your mining rig is headless you can start X in a screen session:
screen

xinit
Detach screen session: CTRL+A+DCreate cgminer.sh and put this into the file:
export GPU_USE_SYNC_OBJECTS=1

export GPU_MAX_ALLOC_PERCENT=100

export DISPLAY=:0
cgminer --scrypt ...your parameters go here...
Make it executable:
chmod 700 cgminer.sh
Configure cgminer parameters as needed and start mining (
./cgminer.sh
). Done!This entry was posted in tech and tagged bitcoin, centos, linux, litecoin on May 15, 2013.

Post navigation

← JunOS: Finding SNMP object identifiers for your Juniper deviceQuick copy & paste how-to: Install KVM on CentOS →

20 thoughts on “How to: cgminer (Bitcoin, Litecoin etc.) + AMD Radeon driver install on CentOS”

spineless November 27, 2013 at 19:37I am getting an error when I install cgminer. I downloaed thedrivers and the GCminer and was about to start installing GCminer. Ientered the command ./autogen.sh and I get the following error:
configure.ac:39: error: possibly undefined macro: AC_PROG_LIBTOOLIf this token and others are legitimate, please use m4_pattern_allow.See the Autoconf documentation.autoreconf: /usr/bin/autoconf failed with exit status: 1Configuring..../autogen.sh: line 10: /root/cgminer/configure: No such file or directory
Not sure where to start with this one. Any ideas?Replyuniv Post authorNovember 27, 2013 at 20:16Hi! Wow, your comment is the 2nd legitimate comment ever in myblog. :-) Anyway, it seems like not all development tools required forcompiling from source were installed. Are you sure you executed the “yuminstall …” line? In particular: yum install “Development tools”Let me know if this helps or not.Replyhomer December 5, 2013 at 16:22Wow! a blogger who is arrogant to its readers!Wanna be the third:Q: What happened to CPU and GPU mining?A: Their efficiency makes them irrelevant in the bitcoin mining world todayand the author has no interest in supporting alternative coins that are bettermined by these devices.So, how could the Radeon Driver make sense?FelixReplyuniv Post authorDecember 5, 2013 at 19:27I think you misunderstood my comment. His comment was the 2nd legitimate comment ever, all other comments were spam so far.Replyhomer December 5, 2013 at 16:27Serious: cgminer after 3.7.2 does not contain gpu mining any more, so do not check out cgminer from git, use http://ck.kolivas.org/apps/cgminer/3.7/cgminer-3.7.2.tar.bz2Replyuniv Post authorDecember 5, 2013 at 19:37Thanks for the heads-up. I adjusted the instructions.Reply ↓Pingback: Help with a Gigabyte GV-R928XOC-3GD REV2 | COINREGIME.COMPortos January 18, 2014 at 09:11Ops! Fulfilled your instructions, but starting ./cgminer -n reports:FATAL: Module fglrx not found.Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directlyFATAL: Module fglrx not found.Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directly[2014-01-18 08:05:22] CL Platform 0 vendor: Advanced Micro Devices, Inc.[2014-01-18 08:05:22] CL Platform 0 name: AMD Accelerated Parallel Processing[2014-01-18 08:05:22] CL Platform 0 version: OpenCL 1.2 AMD-APP (1214.3)[2014-01-18 08:05:22] Error -1: Getting Device IDs (num)[2014-01-18 08:05:22] clDevicesNum returned error, no GPUs usable[2014-01-18 08:05:22] 0 GPU devices max detectedWhy?Replyuniv Post authorJanuary 18, 2014 at 09:43Hm, for some reason the kernel driver fglrx is not being loaded. As root, trymodprobe fglrxand afterwards runamdconfig –lsato see if your GPUs are found then.ReplyPortos January 20, 2014 at 12:55Alas, nothing:# modprobe fglrx# amdconfig –lsa# amdconfig: No supported adapters detectedReplyuniv Post authorJanuary 24, 2014 at 11:53Hmm. It could be that either fglrx gets not properly loaded, orthat fglrx is fine by itself and your GPUs are really not found. Are you100% sure the GPUs are working in this box? If you have only GPU andthat’s the one where you have hooked up your monitor to, then that’s ayes. :) I would boot the box, and then check “dmesg” to see what theoutput was when fglrx tried to load. Did it even try to load?Replyuniv Post authorJanuary 24, 2014 at 11:55PS: The fact that “modprobe fglrx” didn’t produce any output isgood. Looks like it was loaded then. But make sure it is really there byrunning “lsmod” or “lsmod | grep fglrx”.ReplyVital January 24, 2014 at 05:17hi. i have this:[root@p4-36 cgminer-3.7.2]# CFLAGS=”-O2 -Wall -march=native-I/AMD-APP-SDK-v2.8-RC-lnx32/include”LDFLAGS=”-L/AMD-APP-SDK-v2.8-RC-lnx32/lib/x86″ ./configure–enable-scryptchecking build system type… x86_64-unknown-linux-gnuchecking host system type… x86_64-unknown-linux-gnuchecking target system type… x86_64-unknown-linux-gnuchecking for a BSD-compatible install… /usr/bin/install -cchecking whether build environment is sane… yeschecking for a thread-safe mkdir -p… /bin/mkdir -pchecking for gawk… gawkchecking whether make sets $(MAKE)… yeschecking whether make supports nested variables… yeschecking for style of include used by make… GNUchecking for gcc… gccchecking whether the C compiler works… noconfigure: error: in `/root/cgminer-3.7.2′:configure: error: C compiler cannot create executablesSee `config.log’ for more detailsbefore and after this, evrth was good.as a result – I cant run cgminer:[root@p4-36 cgminer-3.9.0]# ./cgminer.sh./cgminer.sh: line 5: cgminer: command not foundany suggestions?Replyuniv Post authorJanuary 24, 2014 at 12:05Strange. “checking whether the C compiler works… no” means gcc isthere but not working properly. Did you follow my installationinstructions about the required packages and were all packagessuccessfully installed? Double-check whether they were all installed!Make sure yum install “Development tools” finishes without problems.Is this CentOS 32bit? (Show output of “uname -a” and “cat /etc/issue”)Did you really extract the AMD APP SDK in / instead of /opt?I noticed when you tried to execute cgminer.sh you are in a directorycalled cgminer-3.9.0 instead of before cgminer-3.7.2. cgminer-3.9.0does not support GPU mining, so throw it away.ReplyAlex Barringer October 24, 2014 at 18:36For those of you that claim that CGMiner doesn’t support graphicsboards, you’d be full of it. Anything beyond 3.7.2 and it’s forks don’thave GPU support, they have ASIC and FPGA support.The CPU mining support was dropped in the CGMiner 3.5 series.If you can’t get your graphics cards to be recognized by CGMiner,that’s not the fault of the blog owner, you’re not reading theinstructions carefully and obviously not browsing the CGMiner (README)file, if you did, you’d realize your error. Make sure that when youinstall the APP SDK that you reboot your computer, there is a specificreason why you should do this.in order for you to be able to get it to work with say, ATI basedcards. You first have to make sure you have a GP-GPU and not an oldercard that doesn’t support OpenCL, otherwise it won’t work.You need to install the AMD FGLRX entire package (not just thedriver, you need Catalyst, too), I’m using the 14.9 stable drivercurrently, then install AMD APP SDK. I don’t recommend using the ReleaseCandidates (RCs), they’re really buggy, you can use the verion 2.9 butmake sure you download the ADL 7.0 SDK they’re paired together for areason.When all is said and done and you have all the prerequisites out ofthe way and get all the dependencies downloaded and installed.You can use this command line to get the graphics boards to be recognized:./configure –enable-scrypt –enable-openclThose two are required for you to do graphics board mining, even ifyou’re not doing S-Crypt mining and just doing SHA256D, you still needto declare S-Crypt to be enabled, otherwise you can’t do mining on thecards.It’s in the “README”! Do read it, next time!You can get the CGMiner 3.7.2 here:http://ck.kolivas.org/apps/cgminer/old/3.7/Alternately, you can get Kalroth’s version fork of 3.7.2 here:https://github.com/Kalroth/cgminer-3.7.2-kalrothYou must have GIT installed to use the GITHUB version of this.Please read the README.md on that site before you go ahead and try touse it, it will save a lot of headaches. Do read up on how to use GITcorrectly, too.Note: If you get massive hardware errors and then receive no acceptedshares on either version of CGMiner or if doing S-Crypt only and useSGMiner (a fork of CGMiner) you are more than likely using the wronggraphics driver for the ADL and APP SDKs (meaning too old).I line up the following installations:1. ATI FGLRX full installation including Catalyst, version 14.92. AMD APP SDK version 2.9 (not the RC version)3. AMD ADL SDK version 7.0This is what I use on Ubuntu and on CentOS and have no trouble at all using CGMiner or CGMiner-Kalroth.Many of the problems I see people have with this software is because they don’t read the instructions!Note: CGMiner 3.8.x and beyond DO NOT support graphics mining anymore, up to 3.7.2 does.Also, don’t install AMD APP SDK directly as root, that’s dangerous, use “sudo” instead.There is a script in the installation for the SDK called, “Install-APP-SDK.sh”, I highly suggest you use it.sudo ./Install-APP-SDK.shBy default, it will install in the /opt directory, which is what youwant, anyhow. After you install it, reboot your computer normally, it’sactually a requirement for the installation to be completed, do thisbefore you attempt to compile CGMiner.ReplyAlex Barringer October 24, 2014 at 18:42I should also point out that when you use CGMiner for the firsttime, don’t overclock anything, leave your card the way it is and doublecheck your setting for the mining site you’re using. If you have yourIntensity up too high you can also receive massive hardware errors andno accepted shares, same thing can occur when your GP-GPU overheatsand/or your dedicated memory on the card (which usually has no heatsinkson them (design problem).ReplyJ October 28, 2014 at 20:46I have a question, If I am not running a GUI on my CentOS system,and I have 2 x sapphire toxic r9 270x cards does one still need theradeon drivers? Are they only for X of are they needed for cgminer also?ReplyJ October 28, 2014 at 21:17Seems like the post from ‘Alex Barringer’ is pretty helpful.Replyuniv Post authorOctober 28, 2014 at 21:20Agreed. :)Replyuniv Post authorOctober 28, 2014 at 21:18Yes, you still need the Radeon drivers. They are needed for cgminer also.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: