(Guide) Fglrx + AMD APP SDK + Pyrit + Cal++ for AMD Video Cards
Hi all,
This is an alternative to my other post where I explained how to install the OpenCL version of GPU support for pyrit / oclhashcat.
While OpenCL is very easy to install, it is no where near as powerful as Cal++. Below are some statistics for my Radeon HD 6970
Code:
Pyrit Benchmark
OpenCL 50595.56 PMKs/s (graphics card produced 49359.6 PMKs/s)
Cal++ 82695.02 PMKs/s (graphics card produced 81675.5 PMKs/s)
As can be seen, the Cal++ version is much faster.
At time of writing, the latest versions of all software is being installed on a 64bit Kali 1.0.9. This includes:
Code:
Pyrit v308
AMD APP SDK 2.9-1
Fglrx 14.4.2
Cal++ 0.90
1. Update and upgrade kali
Code:
apt-get clean && apt-get update && apt-get upgrade && apt-get dist-upgrade
2. Install headers
Code:
apt-get install linux-headers-$(uname -r)
3. Install fglrx
Code:
apt-get install fglrx-driver fglrx-atieventsd fglrx-control
4. Build xorg files
Code:
aticonfig --initial
5. Reboot
6. Install some dependencies needed for later
Code:
apt-get install libpcap-dev python-dev libssl-dev
7. Download AMD APP SDK from the link below (about 120MB). I'm on 64bit so I downloaded 2.9-1 for linux 64bit. Store it in your home folder. Extract it when finished.
Code:
http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/
cd ~
tar xvf AMD-APP-SDK*.tar.bz2
8. Install AMD APP SDK and accept defaults
9. Update .bashrc to set the correct paths. Insert the block below somewhere near the top (use the blank space under # for examples on line 3)
Add the following
Code:
# AMD APP SDK
export AMDAPPSDKROOT=/opt/AMDAPPSDK-2.9-1
export AMDAPPSDKSAMPLESROOT=/opt/AMDAPPSDK-2.9-1/
export LD_LIBRARY_PATH=${AMDAPPSDKROOT}lib/x86_64:${LD_LIBRARY_PATH}
export ATISTREAMSDKROOT=$AMDAPPSDKROOT
10. Reboot again to update paths as its easiest.
11. Some required files are not provided by AMD APP SDK, so this step is to download them and put them where they need to go.
Code:
mkdir /opt/AMDAPPSDK-2.9-1/include/CAL
cd /opt/AMDAPPSDK-2.9-1/include/CAL
svn checkout https://github.com/clockfort/amd-app-sdk-fixes/trunk/include/CAL .
12. Install some more dependencies for cal++
Code:
apt-get install cmake libboost-all-dev
13. Download cal++ from here (about 90kb). Store it in your home folder.
Code:
http://sourceforge.net/projects/calpp/files/latest/download
14. Extract cal++ and go into the folder created.
Code:
cd ~
tar xvf cal*.tar.gz
cd calpp-0.90
15. Nano the CMakeLists.txt file. Change line 18,19 and 20 to match those below. When changes are finished, save and exit.
Code:
FIND_LIBRARY( LIB_ATICALCL aticalcl PATHS "$ENV{ATISTREAMSDKROOT}" )
FIND_LIBRARY( LIB_ATICALRT aticalrt PATHS "$ENV{ATISTREAMSDKROOT}" )
FIND_PATH( LIB_ATICAL_INCLUDE NAMES cal.h calcl.h PATHS "$ENV{ATISTREAMSDKROOT}/include/CAL" )
16. Time to build and install cal++. Run the following from within the calpp-0.90 folder. Should be ~/calpp-0.90/. Will have warnings but it will finish.
Code:
cmake .
make
make install
17. Checkout and then build pyrit
Code:
cd ~
svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit_svn
cd pyrit_svn/pyrit/
python setup.py build
python setup.py install
18. Move into the cpyrit_calpp folder
Code:
cd ~/pyrit_svn/cpyrit_calpp/
19. Edit line 28 and then line 41 to match those shown below. Once changes are made, save and exit.
Code:
nano +28 setup.py
Line 28 should read
VERSION = '0.4.1-dev'
Line 41 should read
CALPP_INC_DIRS.append(os.path.join(CALPP_INC_DIR, 'include/CAL'))
20. Build and install cpyrit_calpp
Code:
python setup.py build
python setup.py install
21. List pyrit cores and benchmark. You should see your cal++ device in pyrit list_cores
Code:
pyrit list_cores
pyrit benchmark
Problems during CAL++ build
Hi,
sorry for hijacking this HOWTO but I am totally frustrated. Didn't count the fresh installation of my system today (appr. 20) to get pyrit and CAL++ working for my card R9 290X. After I found your guide I hoped that it will work but I failed during CAL++ build. Also tested with SDK 2.7 guided by blackmore but the same error in the end.
complete output on pastebin: http://pastebin.com/30v5k4mp
here just some output for faster reading.
If I would knew that installation is so complicated under linux or kali I would never changed my NVIDIA card to AMD. Since March 2014 I am trying to get my card working with pyrit.
I really really hope that you could help me with my error.
Can you tell me if this an driver error or does it come from CAL++? (see dmesg output last line)
Thanks in advance for reading.
lspci -nnkv
Code:
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii XT [Radeon R9 290X] [1002:67b0] (prog-if 00 [VGA controller])
Subsystem: Tul Corporation / PowerColor Device [148c:2342]
Flags: bus master, fast devsel, latency 0, IRQ 47
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f0000000 (64-bit, prefetchable) [size=8M]
I/O ports at e000 [size=256]
Memory at f7e00000 (32-bit, non-prefetchable) [size=256K]
Expansion ROM at f7e40000 [disabled] [size=128K]
Capabilities: [48] Vendor Specific Information: Len=08 <?>
Capabilities: [50] Power Management version 3
Capabilities: [58] Express Legacy Endpoint, MSI 00
Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
Capabilities: [150] Advanced Error Reporting
Capabilities: [200] #15
Capabilities: [270] #19
Capabilities: [2b0] Address Translation Service (ATS)
Capabilities: [2c0] #13
Capabilities: [2d0] #1b
Kernel driver in use: fglrx_pci
fglrxinfo
Code:
display: :0.0 screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon R9 200 Series
OpenGL version string: 4.4.12874 Compatibility Profile Context 14.10.1006.1001
Code:
root@b0x:~/pyrit_svn/cpyrit_calpp# python setup.py build
running build
running build_ext
Building modules...
building 'cpyrit._cpyrit_calpp' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/opt/AMDAPPSDK-2.9-1/include/CAL -I/usr/include/python2.7 -c _cpyrit_calpp.cpp -o build/temp.linux-x86_64-2.7/_cpyrit_calpp.o -Wall -fno-strict-aliasing -DVERSION="0.4.1-dev (svn r308)"
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/opt/AMDAPPSDK-2.9-1/include/CAL -I/usr/include/python2.7 -c _cpyrit_calpp_kernel.cpp -o build/temp.linux-x86_64-2.7/_cpyrit_calpp_kernel.o -Wall -fno-strict-aliasing -DVERSION="0.4.1-dev (svn r308)"
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
_cpyrit_calpp_kernel.cpp: In function ‘void sha1_process(const SHA_DEV_CTX&, SHA_DEV_CTX&)’:
_cpyrit_calpp_kernel.cpp:429:32: warning: suggest parentheses around arithmetic in operand of ‘^’ [-Wparentheses]
_cpyrit_calpp_kernel.cpp:431:57: warning: suggest parentheses around arithmetic in operand of ‘^’ [-Wparentheses]
_cpyrit_calpp_kernel.cpp:434:61: warning: suggest parentheses around arithmetic in operand of ‘^’ [-Wparentheses]
. OUTPUT OMITTED
. OUTPUT OMITTED
cpyrit_calpp_kernel.cpp:685:49: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
_cpyrit_calpp_kernel.cpp:689:76: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cpyrit
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/_cpyrit_calpp.o build/temp.linux-x86_64-2.7/_cpyrit_calpp_kernel.o -lcrypto -laticalrt -laticalcl -o build/lib.linux-x86_64-2.7/cpyrit/_cpyrit_calpp.so
root@b0x:~/pyrit_svn/cpyrit_calpp# python setup.py install
running install
running build
running build_ext
Building modules...
running install_lib
copying build/lib.linux-x86_64-2.7/cpyrit/_cpyrit_calpp.so -> /usr/local/lib/python2.7/dist-packages/cpyrit
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/cpyrit_calpp-0.4.1_dev._svn.r308_.egg-info
root@b0x:~/pyrit_svn/cpyrit_calpp# pyrit list_cores
Segmentation fault
Checking dmesg gives me
Code:
[ 510.460402] pyrit[9573]: segfault at e1c ip 00007f2491e67399 sp 00007fff59a5c580 error 4 in libaticaldd.so[7f2491d04000+b47000]