Nvidia (NVDA -3.33%) has been a popular technology stock over the years thanks to the terrific growth it has been able to deliver on the back of healthy demand for its graphics cards, which are used across a wide variety of applications. But an earnings warning issued by the high-flying chipmaker's management has got investors worried.

Shares of Nvidia pulled back in August after a solid performance last month. That's not surprising, as the company's preliminary results for the second quarter of fiscal 2023 have set the alarm bells ringing. Nvidia anticipates just 3% year-over-year revenue growth in fiscal Q2 (for the three months ended July 31, 2022) to $6.7 billion. The company is going to miss its original forecast of $8.1 billion in revenue by a huge margin, thanks to the sharp decline in its gaming business, which was down 33% year-over-year last quarter. 

This alarming decline in Nvidia's gaming business -- its second-largest source of revenue -- isn't surprising, as prices of graphics cards have been pulling back in recent months on account of weak demand. However, Nvidia's rival Advanced Micro Devices (AMD -0.35%) seems insulated from the headwinds that affected the former last quarter.

Why AMD is thriving when Nvidia is struggling

AMD's results for the second quarter of 2022 were outstanding. The company reported 70% year-over-year revenue growth to $6.6 billion and a 67% jump in non-GAAP earnings to $1.05 per share. The chipmaker saw tremendous growth across its entire business, and it also benefited from the acquisition of Xilinx (completed in February).

It is worth noting that AMD's gaming segment recorded a 32% year-over-year spike in revenue to $1.7 billion, which was in stark contrast to Nvidia's performance. This impressive jump isn't surprising, as AMD has a more diversified gaming business when compared to Nvidia. For instance, AMD's semi-custom processors are used in gaming consoles from Microsoft, Sony, and Valve.

Nvidia, on the other hand, supplies its chips for the Nintendo Switch consoles. That means AMD can move more units of its semi-custom chips thanks to a broader customer base. More importantly, sales of gaming consoles are expected to head higher at a time when sales of personal computers (PCs) are declining.

Sony, for instance, expects to sell 18 million units of the PlayStation 5 (PS5) console in the current fiscal year that ends in March 2023. That would be a nice jump over last fiscal year's shipments of 11.5 million units. Meanwhile, Microsoft is expected to sell 21 million units of the Xbox Series X console this year compared to 12 million units last year. Valve, on the other hand, is reportedly going to ramp up the production of its Steam Deck handheld console in a bid to double shipments.

However, Nintendo has reduced its forecast for Switch sales this fiscal year by 10% compared to the last one. Throw in the fact that sales of PCs are expected to decline 8.2% this year as per IDC, and Nvidia's addressable market for its graphics cards is going to shrink as these chips are used for powering gaming PCs.

Of course, AMD also sells graphics cards that go into gaming PCs, and the company saw a decline in sales in this segment. But growth in semi-custom sales helped it offset the decline in graphics cards, as CEO Lisa Su said on the latest earnings conference call.

Additionally, AMD sees record revenue from sales of semi-custom processors this year, indicating that its gaming business should remain solid despite the potential weakness in the PC market.

The better buy

AMD forecasts 60% revenue growth in 2022 to $26.3 billion. Analysts expect Nvidia's top line to increase 15% in the current fiscal year to $31 billion. AMD's acquisition of Xilinx, its solid position in the semi-custom business, and market share gains in the PC and server processor markets are the reasons why the company could achieve such impressive growth this year.

More specifically, AMD gets a quarter of its total revenue from the gaming business. Nvidia, meanwhile, got 46% of its revenue from selling chips into the gaming hardware market last fiscal year. A more diversified business and AMD's stronger access to the gaming console market should help it mitigate any weakness in the graphics card space and deliver the healthy growth management is forecasting.

What's more, AMD is trading at 41 times trailing earnings and 23 times forward earnings. Nvidia trades at 48 times trailing earnings and 49 times next year's earnings. Considering the much faster growth that AMD is expected to clock and its relatively attractive valuation, buying this tech stock over Nvidia looks like a no-brainer right now.