The artificial intelligence (AI) market has exploded this year, with the launch of OpenAI's ChatGPT reigniting interest in the technology. AI has the potential to boost countless industries, including education, healthcare, consumer products, cloud computing, e-commerce, and more. As a result, companies developing the chips that make AI possible have enjoyed major stock gains in 2023.

Shares of Nvidia (NVDA 6.18%) soared 220% year to date, with Advanced Micro Devices (AMD 2.37%) up 87%. Nvidia rallied investors by getting a head start in AI thanks to its years of dominance in graphics processing units (GPUs). Meanwhile, AMD is gearing up to launch a powerful new chip in 2024 that could shake up the market.

As leading chipmakers, Nvidia and AMD have been closely compared for years. They both offer attractive ways to invest in AI, and could go far over the long term. So let's take a closer look at these companies and determine whether Nvidia or AMD is the better stock to invest in the $137 billion AI market.

Nvidia: Snapping up a majority market share

Nvidia has become one of the biggest names in artificial intelligence this year, achieving an estimated 80% to 95% market share in AI chips. The company has profited from becoming the primary GPU supplier for numerous companies, and its competitors have been slow to catch up.

Data from TrendForce shows ChatGPT's GPU demand hit 20,000 in 2020 and could soon rise to 30,000 as it readies for commercialization. The figures illustrate how quickly the need for high-powered chips is snowballing, with many tech companies developing their own large language models and similar AI chatbots.

Nvidia has enjoyed boosts in revenue by selling its GPUs to ChatGPT. However, it stands to gain even more from the companies working to challenge OpenAI that are turning to Nvidia for their own hardware needs.

In the third quarter of 2024 (ended October 2023), Nvidia's revenue rose 206%, as operating income soared more than 1,600%. The growth was mainly owed to a 279% increase in data center revenue as AI chip sales skyrocketed.

Competing AI chips will likely land on the scene in 2024, but Nvidia's command of the market will be a challenge for most companies to overcome.

Advanced Micro Devices: Significant potential next year

While Nvidia has firmly established its position in AI, AMD is just getting started. AMD began this year on the back foot, with Nvidia's success highlighting just how far behind the chipmaker had fallen in AI. However, AMD spent the last few months investing heavily in the industry and preparing to make a big splash in the sector in 2024.

Next year AMD will begin shipping the newest addition to its MI300 lineup of chips with what it calls its most powerful GPU ever, the MI300X. The new chip is designed to go head to head with Nvidia's offerings, and could pose a threat if it can offer a competitive price-to-performance ratio.

Meanwhile, Microsoft announced last month that Azure would become the first cloud platform to use the MI300X, enabling new generative AI capabilities. The partnership could kick off a lucrative launch for AMD.

In addition to hardware gains, AMD acquired start-ups Mipsology and Nod.ai this year to bolster the software that accompanies its chips. The technology from these companies will likely allow AMD to offer a system for AI developers to get the most out of its GPUs.

Is Nvidia or AMD the better artificial intelligence stock?

Chips are crucial to the future of AI, with demand only likely to continue rising in the coming years. While AMD and Nvidia both have massive potential in the market over the long term, that doesn't mean they're both buys right now.

AMD Price to Free Cash Flow Chart

Data by YCharts

The table above compares the change in the companies' price-to-free cash flows and price-to-earnings ratios over the last six months. These are helpful metrics when determining a stock's value, and the lower the figure the better.

The table shows that AMD shares are currently at their most expensive point since June. Meanwhile, Nvidia's are at their cheapest point.

AMD's stock has risen high this year, with its financials unable to match its valuation. However, Nvidia's massive gains in revenue and operating income in recent quarters have increased the value of its stock even while its share price delivered far more growth than AMD.

So if you're between these two companies and interested in investing in AI, Nvidia stock is a no-brainer.