Bitcoin Mining with Open Source Drivers

* Update all the code necessary to run bfgminer has been pushed upstream

On Monday, I started to work on getting one of the many bitcoin mining applications, bfgminer, to work with clover and r600g.  Since then, I have uncovered and fixed a number of bugs in the compute stack and now with some final bug fixes from R600 backend developer Vincent Lejeune, I have bfgminer working with the Open Source drivers! (Also, thanks to Aaron Watry for implementing the rotate builtin for libclc!)

If anyone is interested in testing, you can follow the installation instructions for gallium compute here, and instead of the standard branches listed in the instructions checkout r179204 from the clang tree, and use the bfgminer branch from the following repos:


Additionally, you will need to invoke bfgminer using the command line options in this script (you will need to modify the script to add your preferred bitcoin address). Currently, bfgminer will only work on Evergreen and non-Cayman Northern Islands GPUs.

There is still one bug that will occasionally cause a hash value to be miscalculated.  When this happens, bfgminer will report a hw error, but this is not serious and the program will continue to run.

The compiled kernel code for bfgminer is not very well optimized yet and there are still a lot of things that can be done to improve performance.  For now, I’m going to work on getting these patches upstream and writing some piglit tests for the bugs, but maybe in the future I’ll have some time take a closer look at the kernel performance.  I have a few ideas for things to do to improve performance, so if anyone is interested in playing around with the code, just ping me on irc.  My nick is tstellar, and I’m usually in #radeon and #dri-devel on  There may even be a few things that would make good Google Summer of Code projects for any students out there interested in GPU performance and/or bitcoin.

* Update: bfgminer now autodetects the Mesa platform, so the bfgminer patch is no longer required.