Nvidia (NVDA 2.81%) hasn't reported second-quarter earnings yet, but we've heard from enough of its major customers by now that it's a good bet that the company will deliver another strong set of numbers when its update comes in at the end of August.

After tumbling in April on fears around trade negotiations, the stock has come roaring back, nearly doubling and becoming the first stock to cross the $4 trillion market cap threshold.

With earnings reports now in from the rest of the "Magnificent Seven," it's clear that spending on cloud infrastructure and the Nvidia components necessary to run artificial intelligence (AI) models has continued apace.

Alphabet said that it would spend $85 billion in capital expenditures, up from a previous forecast of $75 billion. Meta Platforms also lifted the bottom end of its capex spending forecast from $64 billion to $66 billion as CEO Mark Zuckerberg touted the company's investments in its new Meta Superintelligence Labs.

Microsoft (MSFT 2.20%), meanwhile, said it would spend a record $30 billion in capex in the current quarter. The company also reported blowout growth in its Azure cloud infrastructure business, which was up 39% in the fiscal fourth quarter and 34% for the year, topping $75 billion.

For the first quarter, it expects 37% constant currency growth at Azure. But there was one quote that stood out on Microsoft's earnings call that bodes particularly well for Nvidia. Describing the Azure business, CFO Amy Hood said, "While we brought additional data center capacity online this quarter, demand remains higher than supply." Looking ahead, Hood expects that pattern to persist, saying, "Even as we continue bringing more data center capacity online, we currently expect to remain capacity constrained through the first half of the fiscal year."

The letters "AI" made up of glowing cubes.

Image source: Getty Images.

What it means for Nvidia

Microsoft is one of Nvidia's biggest customers. For a cloud computing platform like Microsoft that finds itself capacity constrained after growing 39%, there's only one solution: buying more Nvidia GPUs.

After all, Nvidia dominates the market for data center GPUs, forming the infrastructure that runs AI training and AI inference workloads. Increased spending on capex at the big cloud computing companies will directly translate into increased revenue for Nvidia.

Additionally, as big tech companies take bigger swings at AI, such as what Meta's doing with superintelligence, demand for Nvidia's hardware should continue to grow.

Is Nvidia a buy before its Q2 earnings report?

Nvidia stock has gotten pricier as it's rallied over the last three months, and it now trades at a price-to-earnings ratio of 56, which is more expensive than you'd expect for a stock with a market cap of $4.2 trillion.

However, while Nvidia's growth rate has slowed from the triple-digit numbers it was reporting earlier in the AI boom, its business is still surging. Analysts expect revenue to grow 52% in the second quarter to $45.7 billion, and they expect earnings per share to jump from $0.68 to $1.

Nvidia also has the potential to deliver breakout growth in emerging technologies like autonomous vehicles and even quantum computing, which helps explain why the stock deserves to trade at a premium even as it's the most valuable company in the world.

As for its Q2 earnings report, which is due out Aug. 27, the stock looks like a buy based on tailwinds in AI and the company's potential to lead future technological breakthroughs.

The recent surge may put the brakes on near-term growth, but Nvidia still looks like a long-term winner.