Friction basically. In a perfectly idealised version of the system with no friction/slack/materials being deformed/etc, if you started it off then let go then everything would keep spinning forever. You don't need to pump a whole lot of energy into the device to make it go.
That's a big if. I haven't done the math yet, but I'll bet that the outside rim of at least one of the gears would have to be started moving faster than the speed of light. I'm not sure how you would do that.
The gear just before the first gear at light speed would have the outside rim moving at about 100th of the speed of light. It would take quite a bit of energy to do that.
(Others have pointed out that at speeds well before the speed of light, some of the gears would melt. I'm ignoring that.)