A giant hotel in Houston teemed with oil and gas executives earlier this month for CeraWeek. IHS Markit, a research firm which organized the shindig, lined up America's energy secretary, the chief executives of BP and Chevron and other luminaries. Among the dark suits was an open-collared newcomer: Andy Jassy, head of Amazon Web Services.

Speaking to a vast ballroom, he extolled the cloud-computing giant's virtues of moving quickly and learning from failure. But Jassy was not there just to offer management advice. He was also after their business.

Energy companies are keen to produce oil and gas more efficiently, as they grapple with volatile prices and uncertain long-term demand. Digital investments promise to cut costs and boost output. Tech giants like Amazon, Microsoft and Alphabet, as well as a clutch of startups, want to help.

For all of Silicon Valley's professed support for clean power over fossil fuels, the energy industry represents a huge opportunity.

The abundant shale oil fields also highlight the utility of new analytics, said consultant Paul Goydan of BCG, as data gush from thousands of wells studded through Texas, North Dakota and other rich fields. Falling costs of sensors, storage and computing power have made digital investments even more attractive.

Early projects are starting to bring results. BP is combining real-time information from sensors with its own models and analytics to optimize output — it estimates such digital tools boosted oil production by more than 30,000 barrels per day last year.

Yuri Sebregts, the chief technology officer for Shell, said it could take months for a geoscientist to map faults underground. Software can now perform the same task in a few hours for about $20.

As such efforts ramp up, energy firms are pairing in-house expertise with that of the tech industry. In February ExxonMobil said its sprawling shale operations in the Permian basin in Texas would use Microsoft's services.

Amazon is trying to catch up. The size of its oil and gas team has tripled in recent years, and the company is working with energy giants such as Halliburton and Shell.

Energy companies feel somewhat jittery about working with large tech firms — and not just because the Silicon Valley stars have outshone them. Automation raises the risk of hacking.

Tech firms' ballooning ambitions also raise eyebrows. One participant asked Jassy if Amazon would itself start producing oil and gas. He said no, as the room giggled nervously.