tHog

DIARY 2013

(2012)

DECEMBER

NOVEMBER

OCTOBER

SEPTEMBER

AUGUST

JUNE

MAY

APRIL

MARCH

FEBRUARY

JANUARY

2013

Thu, Jun 13

<12:57 EEST> At this point of the summer, I find myself in the classical situation of being involved in several projects, without getting enough done in any of them. Two theatre projects have recently started with yours truly as the music/sound guy, and so far there is very little development in this aspect of either. I guess one problem is letting go of the previous gig and its catchy melodies (ahem ;) On the other hand, I have also found myself acting onstage in one of these plays, and the real-life training has already taken quite a bit of time and energy, whilst providing loads of fun experience. Meanwhile, I still like to play with computers a lot.

Last Sunday, Hoo got a new motherboard+CPU+GPU combo. The old mobo has a new life in yet another worker in my cluster, Louhi. In fact, the new mobo and Louhi's GPU had been louhing away for a couple of weeks already, but it took a while to summon the courage for the final update.

This Asus E45M1 is one of those boards I had been eyeing for that perfect movie machine for some time. Of course, it turns out not quite perfect, but still better than the Zotac in many aspects. For example, it has a decent integrated GPU that works for movies while the other GPUs are busy working on other problems, and several SATA ports that actually work (after setting the mode from IDE to AHCI in the BIOS first).

On the other hand, the Zotac is great for the computing cluster node that does not need too many ports, SATA or otherwise. The Zotac also happens to have an integrated WLAN, for which I did not find much use until now. It's just what the Master ordered when there are no free Ethernet ports, not much need for channel capacity, and an indecisiveness about the machine's final whereabouts.

Fellow Bitcoiners should know already that this is not a good time to buy GPUs for mining. As I ordered the new HD 7970, which must have been a couple of months ago, I was mainly thinking of (a) supporting a Finnish Bitcoin business, (b) Litecoin, and most importantly (c) how nice it is to play around with new hardware. It turns out this card is great for Scrypt, and I think it will be a long while before the FPGA/ASIC arms race reaches Litecoin. On the other hand, Litecoin may not be that worthwhile or important generally, but hey, it's another nice experiment.

As for the aforementioned arms race, I have refused to invest in an ASIC Bitcoin miner for now, for a few key reasons. First of all, every product promised so far is horribly late. I am certain this reflects the general problems of bringing something completely new to the market. The first iteration of anything, even when delivered, is bound to have serious limitations, so it may be worth waiting for the second generation.

A more systemic problem, IMHO, is the arms race itself. As people wield more and more hashing power, the network adjusts by diminishing the returns for an individual miner. When the Application Specific Integrated Cat is out of the bag, I expect an exponential cycle of greed where the real winners are the hardware vendors. The old anecdote about gold rushes, where people selling shovels and pans made a better average deal than the actual miners, has already been discussed to death in Bitcoin forums, but I think only with ASICs will we see this effect in all its seriousness.

Looking back as an early adopter, I think I have struck a nice balance between saving for future, selling to maintain the habit, and buying some nice hardware to play with. Not to mention actually playing with it, for example learning to hack FPGAs. From an investment point of view, I have mixed feelings; I should probably have focused more on simply saving, or outright buying BTC when the price was something like 10 cents apiece. On the other hand, with that kind of an outlook you would miss all the fun. I don't see buying an ASIC as fun, and I'm not even sure of their investment potential, because everyone else could get one too, making them effectively worthless. I think this is called inflation, the very thing Bitcoin was designed to fight against.

Fri, Jun 7

<15:29 EEST> If Chinese knockoffs are a sure sign of success, then I guess I'm on to something :)

Two years ago, I had one of the first FPGA Bitcoin miners, having ported the fresh opensource code to another device and serial comms myself. I played around with FPGAs for that summer, and in the end I got the fancy idea of chaining several FPGAs together for a potentially huge and powerful cluster. It was a fun exercise, I received small donations in BTC and hardware, but nothing substantial. I basically forgot about developing these, as the general talk around FPGAs, and later ASICs, was becoming more about big and professional than a fun hobby. Besides, I had a day job. Of course, I have kept on mining BTC and other cryptocoins, but I was just tired of following every single new announcement in the mining scene.

As for mining, there was a big limitation in my FPGA setup, and I presume many others. They only used the original getwork protocol, which was heavy on the network and inefficient in some further ways. Using Long Polling or the newer Stratum would have required changes in both the FPGA and the software. I knew I could easily fix the FPGA side, but software would be a problem, partly because mine was stuck on a rather limited Python JSON-RPC library. I sometimes wondered if I could just plug my FPGA into cgminer, the software that supports all major mining hardware.

Last week or so, I decided to take a deeper look. Cgminer's usbtest.py looked like a nice starting point. There was something familiar about it... in fact, several lines verbatim from my miner.py. How did that happen? Had someone already ported my setup to cgminer?

I then noticed that those lines belonged to a section for Icarus FPGA miners. From then on, it was not hard to find that Icarus had, in fact, used a lot of my serial cluster code. Verbatim copies again, whole files in some cases.

At first, I was incredibly annoyed by this. Some guy is advertizing a project as his own development, and selling devices, without giving any credit to the original coders. Of course, it is all under GPLv3, and the comments identifying the original authors are intact. Nevertheless, I'm not sure if the spirit of GPL is followed here.

On the other hand, during these intervening years, I have neither developed nor promoted my work very actively. I think I have even declined some vague business propositions, though I recall nothing from the Icarus guys. Some collaboration requests I have taken more seriously, but so far there has been no real development in them. But at least somebody is using my code; it's good enough for Icarus (and possibly its follow-up Lancelot and Avalon projects). This is pretty much the spirit of BSD licensing; we like to see good code being put to good use, and we hate to see good code rot in someone's basement doing nothing. Even if I see no fame or fortune from it, I'm actually quite honored by this :-j

So, what about getting my FPGA to work with cgminer? It was a simple fix on the FPGA, as Icarus had documented the protocol separately. Cgminer is a little picky about recognizing the device, but with some restrictions it works. It's funny, I had thought this cgminer port would be somehow 'too hard/tedious' for me, and it was so easy — though all that time I was overwhelmed by the spectrum of emotions about the Icarus case.

As I announced this in the forum, it was also nice to catch up with other developments. For example, there was a new, GPLv3 library for serial comms that I can use to replace the nonfree alternative from fpga4fun. It's funny how much my choice of serial comms was criticized at first, but a lot of the serious mining projects are actually using it, it's just under the hood in the form of TTL level signals via USB-serial converter.

If there's anything about these FPGA enveavours I regret, it's the design of the serial protocol. It was very minimalistic to begin with, and from the first few days I have been thinking about improvements. Since it did the job, I never got around to implementing anything better. To properly support LP/Stratum, it would need other return codes in addition to the single 32-bit number. Icarus's extension, IMHO, is an ugly hack. I can understand the choice in some way, but jeez, when you're changing a protocol anyway, you could do a little better. Maybe next time ask the original developer for help and insight :-j


Risto A. Paju