Skip to content
Philippe Delteil edited this page Feb 26, 2019 · 7 revisions

GPU Acceleration

By far, this is the most awesome feature of Pyrit, besides its storage/speed tradeoff. As of version 0.5.0, to enable GPU computing, you must edit your config file located at ~/.pyrit/config and set either CUDA or OpenCl to 'true' like so:

use_CUDA = false
use_OpenCL = true

Another cool feature added to the config file is that if limit_ncpus is set to a number below zero, Pyrit will disable all CPU cores, piping the work to the GPU, which is usually more (power and performance) efficient.

Nvidia-CUDA

Get yourself a copy of the CUDA-Toolkit from http://www.nvidia.com/object/cuda_get.html. You need to modify either $PATH and ldconfig or setup.py if you choose not to install the Toolkit into either '/usr/local/cuda' or '/opt/cuda' so CPyrit-CUDA's installation routine can find Nvidia's compiler 'nvcc'. You also need to have Nvidia's proprietary hardware-drivers installed in the way that fits your OS.

Switch to the directory holding CPyrit-CUDA's source-code inside Pyrit's repository and compile it just like you did with Pyrit:

cd modules/cpyrit_cuda/
python setup.py build
sudo python setup.py install

Executing 'pyrit list_cores' should list your GPUs. Please see the troubleshooting-wiki if it doesn't work.

Note: If you are using anacona python you may need to link CUDA libraries to the anaconda /lib directory by doing

ln /usr/local/cuda/lib/* /Users/$USER/anaconda/lib/

OpenCL

OpenCL is currently supported by Nvidia (GeForce GPUs), AMD (ATI Radeon GPUs and SSE3-capable CPUs) and IBM (CELL B.E. CPUs). You can get a copy of the SDKs that are required to build CPyrit-OpenCL from the following sites (registration required):

Please see the drivers' installation instruction for how to get everything up and running. The SDKs usually include simple demos and examples. First try to get those demos working and you'll most probably have no problems installing CPyrit-OpenCL.

Switch to the directory holding CPyrit-OpenCL's source-code inside Pyrit's repository and compile it just like you did with Pyrit:

cd modules/cpyrit_opencl/
python setup.py build
sudo python setup.py install

Executing 'pyrit list_cores' should list your GPUs. Please see the Troubleshooting page if it doesn't work.

Clone this wiki locally