Intel Corp. INTC -0.10% and Nvidia Corp. NVDA -0.41% have had a long coexistence as chip makers targeting different segments of the computer market. But a significant shift is under way that is making them competitors in one of the fastest-growing markets in tech. Tens of billions in sales are at stake.

It doesn’t even seem close now. Intel has about 8 times the annual sales of Nvidia, thanks to its dominance in the huge market of personal computers and servers. But as companies like Google-parent Alphabet Inc., Microsoft Corp. and Amazon.com Inc. AMZN -2.25% spend billions on huge networks powered by artificial intelligence, the market for the types of chips that power those networks is in flux. And the ultimate winner is far from clear.

Intel’s strength has been in central processing units, or CPUs. These are the types of chips that form the brains of PCs and servers. Nvidia specializes in graphics processing units, or GPUs, which are designed to render graphics and images.

GPUs are most frequently used in high-end personal computers designed for video gaming. But they are also well suited to many of the types of tasks required for the machine learning that makes artificial intelligence possible. They also can accelerate the performance of CPUs of the type made by Intel.

Get financial insights and commentary on global investing from The Wall Street Journal’s Heard on the Street team. Subscribe to the podcast.

This gives GPUs a growing role in data centers. Analyst Patrick Moorhead of Moor Insights & Strategy says “the importance of non-CPU compute engines is increasing,” with GPUs driving “incredible” performance in the training functions of machine learning.

This has played out nicely for Nvidia so far. The company’s sales to its data-center segment topped $1 billion for the trailing 12-month period ended April 30—more than triple from the same period last year but still a fraction of Intel’s $17 billion in data-center sales. Nvidia’s shares had already more than tripled in the year leading up to its fiscal first-quarter report last week; they have soared another 30% since.

Nvidia’s growing role in the data center could pose a threat to Intel, as more GPUs sold for machine learning could mean less demand for Intel’s offerings. But it would be wrong to count the chip giant out at this point. It controls more than 98% of the server chip market now and already embeds its own GPU technology with its CPU chips. Also, Intel has made acquisitions to further its data-center lead, including its $16.7 billion purchase of Altera and—more recently—a small-but-promising outfit called Nervana.

The winner, if there is one, is a long way away. Google, Microsoft and Amazon are still in the early days of building their artificial intelligence networks—and none is taking the exact same approach. Google, in fact, has designed its own chips to boost machine learning. That leaves plenty of room for new fortunes to be made—or lost.

Write to Dan Gallagher at dan.gallagher@wsj.com