Segfault when attempting to run cgminer on ubuntu 10.04 I recently wanted to try mining some crypto-currency, and litecoin seemed to be a good way to start since it doesn't require too specific hardware.
However, running cgminer after install (which was completed without errors) ends in Segfault.

Machine configuration :
Ubuntu 10.04
ATI Mobility Radeon HD 4500 series

I might be missing some packages, since no tutorial has the same list, but since the install didn't complain, I assumed everything was OK.

The steps used so far :


got the cgminer-3.7.2 x86_64.tar.bz2 (seems to be the last that supports GPU mining)
installed AMD APP SDK 2.9
mkdir amdapp_2-9

cd amdapp_2-8
tar -zxvf ~/Downloads/AMD-APP-SDK-v2.9-lnx64.tgz
sudo ./Install-AMD-APP.sh
sudo reboot

installed ADL SDK 6.0

mkdir ADL_SDK
cd ADL_SDK
mv ~/Downloads/ADL_SDK_6.0.zip .
unzip ADL_SDK_6.0.zip
cp include/* ../cgminer/ADL_SDK

installed cgminer

CFLAGS="-O2 -Wall -march=native -I /opt/AMDAPP/include/" LDFLAGS="-L/opt/AMDAPP/lib/x86_64" ./configure --enable-opencl --enable-scrypt
make
make install

did some exports

export DISPLAY=:0
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100



And finally, I wanted to test via

./cgminer -n


That failed miserably, as all I got was a Segfault.

Here is the result of the configuration step :

cgminer 3.7.2
------------------------------------------------------------------------


Configuration Options Summary:

libcurl(GBT+getwork).: Enabled: -lcurl  
curses.TUI...........: FOUND: -lncurses
OpenCL...............: FOUND. GPU mining support enabled
scrypt...............: Enabled
ADL..................: SDK found, GPU monitoring support enabled

Avalon.ASICs.........: Disabled
BFL.ASICs............: Disabled
KnC.ASICs............: Disabled
BitForce.FPGAs.......: Disabled
BitFury.ASICs........: Disabled
Hashfast.ASICs.......: Disabled
Icarus.ASICs/FPGAs...: Disabled
Klondike.ASICs.......: Disabled
ModMiner.FPGAs.......: Disabled

Compilation............: make (or gmake)
CPPFLAGS.............: 
CFLAGS...............: -O2 -Wall -march=native -I /opt/AMDAPP/include/
LDFLAGS..............: -L/opt/AMDAPP/lib/x86_64 -lpthread
LDADD................:  -lcurl   compat/jansson-2.5/src/.libs/libjansson.a -lpthread -L/opt/AMDAPP/lib/x86_64 -lOpenCL    -lm  -lrt

Installation...........: make install (as root if needed, with 'su' or 'sudo')
prefix...............: /usr/local
I realize this question is 8 months old but this information may be of value to others seeking a resolution to a segfault as there seems to be no information available at all on the problem. The APP SDK seems to be incompatible with ATI legacy drivers.

The APP SDK is probably causing the segfault. I have a HD4770 and it was working with a pre-compiled copy of cgminer.

When I installed the APP SDK to compile sgminer everything seemed ok, sgminer compiled ok

However is gave me a segfault and when I tried to run cgminer that was working it too gave me a segfault.

After 3 days, I have been unable to restore things the way they were and undo the changes the APP SDK install made.

I fear that a complete OS reinstall will be my only solution.

Also. the flags '-march=native' enables special cryptographic instructions that are incompatible with AMD CPU's before Bulldozer.