Both Nvidia (NVDA -3.33%) and Advanced Micro Devices (AMD -0.35%) have seen fantastic stock gains this year, with their share prices climbing 166.5% and 96%, respectively. But while Nvidia now trades at all-time highs, AMD stock remains down about 21.5% from its peak and has yet to fully recover from the bear market that crushed valuations for growth stocks.

Which of these leading semiconductor companies is the better investment at today's prices? Read on for competing bull cases on the stocks and a conclusion on which one looks like the better buy right now.  

The case for Nvidia

Nvidia's recent first-quarter report arrived with results that breezed by Wall Street's targets and guidance that crushed the market's expectations. After growing sales 19% sequentially to reach approximately $7.2 billion, the company now expects sales of $11 billion in the second quarter -- good for sequential growth of nearly 53%.

Nvidia is also targeting a non-GAAP (adjusted) gross margin of 70% in the current quarter. Remarkably, there's probably still room for improvement from that record level. 

While Nvidia was once primarily focused on providing processors for gaming and other performance-intensive visual applications, the company has transformed its business to revolve heavily around data centers. Now, the company is pushing into offering artificial intelligence (AI) computing and applications as a service. 

Nvidia's leadership in the graphics processing unit (GPU) space allowed it offer its high-end processors to new categories and applications. Nvidia has already been making partnerships with top companies in the enterprise software space, announcing team-ups with Microsoft and ServiceNow to roll out AI-powered applications and services for businesses. Through these initiatives, the company will likely be able to push its already very strong margins to new heights. 

Due to the company's category-leading position in ultra-high-end processors and the iterative benefits that access to valuable data confers in the AI space, Nvidia could be in the early stages of building a nearly insurmountable lead in its corner of the tech industry. 

The case for AMD

With Nvidia reaching a $1 trillion valuation and trading at approximately 40.5 times next year's expected earnings, its stock is priced for perfection. 

NVDA Market Cap Chart

NVDA Market Cap data by YCharts

While AMD also has a highly growth-dependent valuation and trades at roughly 30.5 times next year's expected earnings, it may be less risky and offer greater upside potential. The company should be able to continue gaining share from Intel in the central processing unit markets for computers and servers, and it will likely also see positive demand catalysts for its GPUs and other processors. 

Even though AMD has gotten a significant valuation boost thanks to Nvidia's stellar AI-driven earnings and guidance beats, the market may still be underestimating the smaller company's strengths and opportunities in artificial intelligence. With midpoint guidance for revenue of roughly $5.3 billion in the current quarter, the company is guiding for sales to be roughly flat on a sequential basis and decline approximately 20% year over year. But AMD could have some powerful bullish performance catalysts on track to hit in the second half of 2023. 

While Microsoft has partnered with Nvidia, it's also building a partnership with AMD and has already been purchasing the company's AI-focused MI250 chipset. The processing specialist is on track to launch its MI300 accelerator processing unit later this year, and the new processor could deliver a substantial step up in performance for the company's data center customers.

Like Nvidia, AMD is probably still in the early stages of AI-driven demand, but it still trades at a substantial discount compared to its previous high. 

So which is the better buy?

Ultimately, I think that AMD presents the superior risk-reward proposition based on where the two stocks are valuation-wise. Nvidia is clearly the stronger company right now, and it's positioned to score huge wins thanks to the role that it's playing in the rise of artificial intelligence. But AMD is no slouch in the AI category, and its valuation profile leaves the door open for stronger long-term stock performance. 

It's worth noting that investors don't necessarily have to choose between these two leading semiconductors stocks. For those looking to build broad-based portfolio exposure to the rise of AI and broader chip industry, building positions in both AMD and Nvidia could be the right move.