Nvidia (NVDA 3.46%) has been one of the top beneficiaries of exploding demand for hardware needed to handle the demands of training computers to think like humans. Last year's launch of OpenAI's ChatGPT revealed the capabilities of chatbots powered by artificial intelligence (AI).

Data centers and researchers are scrambling to buy Nvidia's advanced data-center chips and systems to realize the full potential of this technology in many areas, including product recommendations, fraud detection, cybersecurity, self-driving cars, and humanoid robots.

The surging demand has pushed the stock up 185% year to date. Shares haven't advanced in the last few months and have pulled back off their highs. The opportunity in AI could push it higher over the long term, but there's one risk investors should be aware of before buying the stock.

Buy reason No. 1: Profitable growth from AI

Nvidia's leadership in graphics processing units (GPUs) has made it the go-to provider for hardware and systems for AI workloads. Besides advanced GPUs, it offers software, systems, algorithms, servers, and interconnects for data centers. This has driven massive growth this year, with revenue up 101% year over year in the fiscal second quarter. 

Unlike some AI stocks, Nvidia is converting its revenue growth into profits. Data center products generate a higher profit margin than the company's less-complicated products like graphics chips for video games. As a result, earnings per share (EPS) are growing much faster than the top line, up 854% year over year last quarter.

NVDA Revenue (Quarterly) Chart

NVDA data by YCharts.

For the full year, Wall Street analysts expect Nvidia to report a 91% increase in revenue, with EPS coming in at $10.20. That puts the stock's forward price-to-earnings (P/E) ratio at 38. 

Management plans to increase supply each quarter next year, which suggests good visibility in demand trends. In that context, the stock might not be as expensive as investors think right now.

Looking ahead to next year's analysts' estimates, the stock's forward P/E drops to a reasonable 25. That's a modest valuation for a growth stock, so Nvidia could hit new highs over the next few years as revenue and earnings grow.

Buy reason No. 2: Gaming demand is heating up

Until the last few years, selling GPUs to people who play video games was Nvidia's largest business. Even though gaming chips make up less than 20% of the company's revenue now, it is still a catalyst to watch. 

Gaming revenue slumped last year, but it's starting to grow again. Solid demand for the company's GeForce RTX 40 series of GPUs drove gaming revenue up 11% over the previous quarter and 22% year over year. 

Only 47% of GeForce users have upgraded to RTX. With more games taking advantage of the RTX's cutting-edge graphics capabilities, Nvidia could see a strong finish to the year for the gaming segment. Chief financial officer Colette Kress said on the second-quarter earnings call, "We believe global end demand has returned to growth after last year's slowdown." 

The reason to wait

The biggest problem for Nvidia in the near term is chip export restrictions to China, which could slow the company's momentum. Revenue from China made up 20% of Nvidia's total last quarter. The problem is that analysts have been raising their revenue estimates this year. This sets up the possibility that Nvidia could fall short of those optimistic expectations, causing the stock to tumble.

Wall Street was spooked this week after a report from The Wall Street Journal said that Nvidia could be forced to cancel up to $5 billion of advanced chip orders to China. The stock subsequently fell about 5%. It's clear that the China risk is not fully factored into the stock's valuation.

Long-term growth should swamp any near-term pain from China, but investors might want to wait until after the company's next earnings report before deciding to buy shares. Nvidia will report financial results for the fiscal third quarter on Nov. 21 after the market close.