Why GPU instances are better for hashcat
GPU's are more suitable than CPU's because GPU's are designed to perform work in parallel. Therefore, when there are many identical jobs to perform (like the password hashing function) a GPU scales much better. Hence I was interested in benchmarking Hashcat with the AWS EC2 p3 & g4 instances.
To take advantage of the GPU capabilities these EC2 instances, we need to:
- Run a supported Linux distribution.
- Install NVIDIA driver
Instead of re-iventing the wheel, you use the
Deep Learning AMI provided by AWS. While these AMI's are created for machine learning, they are also great for hashcat. This is because the AMI comes prepackaged with GPU Drivers (v26 of the AMI includes driver version
418.87.01). It also ships with and NVIDIA-DOCKER which enables us to run hashcat in a container that has access to the GPU's.
After spinning up the instance just run the following command to initiate a hashcat benchmark:
nvidia-docker run -it dizcza/docker-hashcat /usr/bin/hashcat -b
- p3.16xlarge ($24.48)*
- 441.1 GH/s
- 60613.2 MH/s
- 31588.0 MH/s
- g4dn.12xlarge ($3.912)*
- 80492.2 MH/s
- 11860.4 MH/s
- 5466.9 MH/s
*Per dollar on-demand price of both instances are almost equal, where the g4 instances are just slightly more cost effective (*based on us-east-1 pricing.)
Find the full results here: