As leading semiconductor companies, Advanced Micro Devices (AMD 1.97%) and Nvidia (NVDA 1.69%) have been in steep competition with each other for years. These companies have grown powerful with their consumer-focused line of PC components, which saw increased demand over the last decade as more and more people opted to build custom computers for high-powered activities such as gaming and video editing. 

However, 2022's PC market declines sent AMD and Nvidia's stocks tumbling 55% and 50%, respectively, throughout the year. According to research from Gartner, PC shipments fell 28.5% in the fourth quarter of 2022 and 16.2% for the whole year. 

Despite market headwinds, investors have rallied in 2023, growing bullish about each company's prospects in artificial intelligence (AI) and other high-growth markets. AMD shares have soared 51% year to date, with Nvidia's rising 87%. Yet, both companies' stocks remain down year over year.

As a result, now is an excellent time to consider investing in one of these companies, which will likely play crucial roles in the future of technology. So, let's examine whether AMD or Nvidia is the better buy.  

Advanced Micro Devices

AMD's stock has increased by 863% in the last five years and 3,600% in the last ten years. Its growth has come alongside annual revenue, which has risen 264% to $23.6 billion since 2019, with operating income climbing 180% to $1.3 billion.

The company's substantial development in recent years has largely come from the success of its Ryzen series of central processing units (CPUs) launched in 2017. Since the components were released in Q1 2017, AMD's consumer CPU market share has increased from 18.1% to 32.2% in Q4 2022. In the same period, Intel's market share has fallen from 81.9% to 62.8%.

AMD's success in PC components has allowed it to expand to other aspects of tech, which managed to make up for market headwinds last year. The company's data-center business reported revenue growth of 64% year over year to $6 billion in fiscal 2022, with operating income rising 86% to $1.8 billion.

Data centers have provided AMD with a less consumer-reliant avenue to profit from its CPUs and graphics processing units (GPUs). These components power data centers worldwide, with demand growing as cloud platforms such as Amazon Web Services (AWS) and Microsoft's Azure continue to expand.

In addition to data centers, AMD's hardware has the power to run and develop AI software, which could prove immensely lucrative over the long term. 

Nvidia

Nvidia shares have skyrocketed in 2023 alongside the company's increasing potential in AI. According to Grand View Research, the AI market is projected to expand at a compound annual growth rate of 37.3% through 2030, valued at $137 billion in 2022. As GPUs are crucial to the industry's growth, Nvidia stands to gain a lot from its development. 

An artificial intelligence race kicked off in November 2022 with the launch of OpenAI's ChatGPT, an advanced chatbot capable of producing human-like dialogue. The software wowed the tech world and prompted countless companies to prioritize AI development. 

As a result, Wall Street has grown incredibly bullish over Nvidia's stock as it is the leading supplier of GPUs to ChatGPT. Research from TrendForce in early March showed ChatGPT required around 20,000 GPUs in 2020, and that number will likely increase to 30,000 as the program prepares for commercialization.

AMD and Nvidia are both likely to profit substantially from the expansion of AI. However, Nvidia's relationship with ChatGPT puts it on a slightly firmer footing in the burgeoning industry. 

Is AMD or Nvidia the better buy?

Despite Nvidia's stronger position in AI, AMD is a more well-rounded company. In 2022, the consumer GPU market saw worldwide shipments fall 42%, with Nvidia's 88% market share resulting in larger losses than AMD's 8% share. For instance, Nvidia reported revenue growth of 0.2% in 2022, while AMD's rose 44% throughout the challenging year.

AMD's growth primarily stemmed from data centers, its embedded business, and its semi-custom chips, which AMD exclusively supplies to many other companies' devices, such as Sony's PlayStation 5, Microsoft's Xbox Series X and S, and numerous other handheld gaming machines. 

Moreover, AMD's forward price-to-earnings ratio of 18 compared to Nvidia's 44 means AMD's stock is currently trading at a far better value. Alongside a solid and diversified business, AMD is the better buy right now.