Updated

When HBO rolled out a mockumentary poking fun at high tech this spring, Silicon Valley checked it out.

Initially, its namesake geeks and nerds who spend their days coding, developing and hacking in a red hot tech economy weren't so sure it was funny: "Most startups are a soap opera, but not that kind of soap opera," said Tesla CEO Elon Musk, one of the valley's most charismatic billionaires, after a premiere.

But many were amused enough by the warped story of their lives to keep watching, and soon some of the biggest names in the Silicon Valley were singing its praise on the region's virtual water coolers.

There were even cameos from locals, including Google executive chairman Eric Schmidt. And, for a day, entrepreneur-investor Marc Andreeson tweeted lines from the show like "I truly believe we can only achieve greatness... if first, we achieve goodness."

Now, with the final episode airing Sunday night, "Silicon Valley" has been upped for a second season — good news for local techies who gather en masse to watch five of their doppelgangers awkwardly talk to women, seek venture capital and try to launch a startup called Pied Piper, complete with its own mock website.

Creator Mike Judge ("Beavis and Butt-Head"), who collaborates as executive producer, writer and director with Alec Berg, taps into his own experience as a Silicon Valley engineer decades ago to nail the authenticity of this funny and sometimes painfully real, show.

"I live it every week," said Silicon Valley venture capitalist Barry Schuler, former CEO of America Online. "We cannot take ourselves too seriously.

Shuler says the socially awkward characters — who wince and blink nervously, get bullied by adolescents, have trouble talking to women and taunt each other awkwardly — are a fair parody of his tech community.

"We don't fit into normal social circles, you know what I mean? What we do is clearly done by a self-selecting group of people who like to sit in dark rooms and write code and make the world a better place," he said.

Much of the show is tied to reality.

A socially awkward coder, played by Thomas Middleditch, turns down a $10 million acquisition offer and instead takes $200,000 in seed money to launch his own disruptive startup file compressor service. Then he vomits.

While there was no public angst when CEOs at firms including Snapchat, Fire Eye and Groupon turned down more than $1 billion offers in recent years, it's reasonable to suspect someone's stomach was turning. "That was such a send up on what happens when big guys start bidding, really inside baseball," said Schuler.

Former stand-up comic Middleditch, who's getting his big break on the show, says he had plenty of inner geek to pull off an authentic introverted Richard, a brilliant, panic-attack prone coder.

"There isn't a huge difference between me and the character," said the Canadian native. "I'm like normally nowadays a pretty chill guy but I've definitely had my bouts of not being the coolest kid on the block, not being able to talk to certain people, into various nerdy things."

An avid gamer, Middleditch says it's gratifying to be appreciated in the birthplace of Google, Apple and Facebook. "As much as we want to appeal to everyone, I think we would consider it a fail if we alienated Silicon Valley," he said.

Not at all. About 1.7 million viewers tune in each week, according to Nielsen ratings, many from the innovative and wealthy center of tech.

"I have this interesting love-hate relationship with the show, because I watch television to escape from my everyday life, and this is like watching my everyday life," but it's slightly over the top. And I do say slightly," said Jen Donahoe, who works at Mountain View, California, messaging app firm Tango. "We are ridiculous here. We are throwing crazy money at 20-somethings because they can write code. But these guys are big kids. They're brilliant and geniuses but they play foosball and make fart jokes."

Devon Crews, head of marketing for Santa Clara, California-based Citrix Startup Accelerator, which invests in early-stage companies, doesn't miss an episode. And he says other entrepreneurs in the accelerator are watching, too. "Some love it. Some love to hate it, but everyone agrees that it is LOL funny," said Crews.

The show has also attracted far flung Silicon Valley wannabes, uniting techies around the world who tweet their favorite lines to each other while they watch.

"All those geeky acts in a place that is like a wonderland for me, Silicon Valley, is just the thing I want to watch in a comedy," said computer scientist Arash Pourhabibi Zarandi via email from Shiraz, Iran.