Nvidia's (NVDA 6.18%) stock price has more than quadrupled over the past three years. Most of that rally was driven by the rapid expansion of the artificial intelligence (AI) market, where its data center GPUs are used to process complex AI tasks.

Two of its better-known customers are OpenAI, the creator of ChatGPT, and its top backer Microsoft. However, Meta (META 0.43%) has also been spending billions of dollars on Nvidia's data center GPUs every year.

Two IT professionals walk through a server room.

Image source: Getty Images.

That's why it wasn't all that surprising when Meta CEO Mark Zuckerberg recently said his company would install 350,000 of Nvidia's top-tier H100 GPUs in its data centers by the end of 2024. Zuckerberg didn't disclose how many H100s Meta had purchased so far, but Nvidia only launched the GPU with a limited supply in late 2022.

Nvidia is currently selling the H100 for $25,000 to $30,000 each, according to analysts at Raymond James, which implies that Meta will probably spend roughly $8.8 billion to $10.5 billion on Nvidia's GPUs over a two-year period. Let's see why that's a bright green flag for Nvidia -- and what it tells us about Meta's near-term challenges and longer-term plans.

Why Meta's support is great news for Nvidia

Nvidia generated $29.1 billion in revenue, or 75% of its top line, from its data center chips in the first nine months of fiscal 2024, which started last January. That's up from 52% of its total revenue in the first nine months of fiscal 2023.

The bulls believe this business will continue expanding as the AI market grows, but the bears expect the AI market to cool off and for new competitors to enter the ring. Meta's big GPU purchases counter those bearish claims in two ways.

First, Meta probably wouldn't spend about $10 billion -- equivalent to about 17% of its combined capital expenditures (capex) of $31 billion in 2023 and $28 billion in projected capex for 2024 -- on Nvidia's H100 GPUs if it thought the AI market was cooling off. Instead, the social media giant probably expects that market to heat up as cloud leaders including Amazon, Microsoft, and Alphabet's Google expand their own AI ecosystems.

According to Precedence Research, the broader AI market could grow at a compound annual growth rate (CAGR) of 19% from 2023 to 2032. Fortune Business Insights expects the generative AI niche to expand at an even faster CAGR of 47.5%. Providing the building blocks for that booming market could drive Nvidia's stock a lot higher.

Second, Meta allays some concerns that Nvidia's largest customers will replace its GPUs with their own in-house chips. Meta, Microsoft, Amazon, and Google have all been developing their own AI chips, but their ongoing purchases of Nvidia's GPUs suggest it could still be years before they produce comparable chips. Instead, their custom chips will probably work in tandem with Nvidia's GPUs to process AI tasks for the foreseeable future.

What Meta's GPU purchases tell us about its future

But for Meta, its massive purchases of Nvidia's GPUs raise some questions about its future. It's still burning billions of dollars on the expansion of its Reality Labs segment, which racked up steep operating losses of $13.7 billion in 2022 and $11.5 billion in the first nine months of 2023 as it rolled out new augmented and virtual reality devices. Its big GPU purchases from Nvidia could exacerbate that pressure -- which already reduced its operating margin from 41% in 2019 to 25% in 2022.

Meta's revenue growth accelerated throughout 2023 as its core advertising business recovered, but that recovery was mainly driven by Chinese e-commerce marketplaces including PDD's Temu and Shein, which ramped up their spending on Meta's platforms to promote their products to overseas customers. If those companies rein in their ad purchases as Meta increases its spending on the expansion of its data centers and Reality Labs segment, its operating margin will shrink again.

But over the long term, Meta's data center investments could pay off by making its AI algorithms more effective at crafting targeted ads, figuring out which Reels keep viewers engaged, and calculating the best prices for its programmatic ads. Meta's collection of first-party data should also completely eliminate its dependence on Apple, which cut off Facebook and Instagram from its third-party iOS data with a major update in 2021.

It's good news for both companies

Meta's commitment to Nvidia indicates that the chipmaker will remain a linchpin of the AI market for years to come. It should boost Nvidia's data center GPU sales and widen Meta's own moat against other ad-driven tech giants such as Google. Simply put, this big GPU purchase is great news for both companies -- although Nvidia will initially generate more sales growth from that deal at the expense of Meta's near-term margins.