Tech stocks have been hit hard in 2022, with the NASDAQ-100 Technology Sector index down 33% year to date. Multiple companies have taken significant hits to their stocks, with Nvidia (NVDA 2.92%) down 54% and Advanced Micro Devices (AMD 1.00%) off 45% in the same period. As key players in the computer graphics market, these companies are often stacked against each other, so it stands to reason that investors might question which is the better buy. 

Tech stocks have fallen out of favor in 2022 as rising inflation and fears of a recession slowed consumer spending. However, they won't be down forever, making them excellent stocks to buy and hold. Although Nvidia and AMD are both attractive stocks for investors looking to hold long-term, one of them is superior. Let's assess. 

Nvidia: A leader in graphics

Nvidia's 29 years of business have built it into a leader in graphics processing units (GPUs), used in gaming, cryptocurrency mining, professional applications, and more. The company also designs chip systems for automotive and robotic products. Nvidia flourished throughout the pandemic, with its stock rising 541% between March 2020 and November 2021 -- when it reached an all-time high. However, the tech stock has lost 58% since its November high as investors lose faith in the company's stability.

The semiconductor company suffered a disappointing second fiscal quarter. Revenue fell 33% year over year to $2.04 billion as consumer demand for its gaming GPUs decreased significantly. Gaming is Nvidia's second-biggest segment, making up 30% of the company's revenue in Q2.

As a result, decreased demand for its gaming GPUs has hit the company hard, with its third-quarter guidance not doing much to rally investors. The chipmaker expects to bring in about $5.9 billion in revenue next quarter, a 15% decline from the previous year, thanks to decreased GPU sales and a shrinking professional visualization segment. 

AMD: Strength in diversification 

While Nvidia saw substantial losses in its second quarter, AMD boasted a 70% rise in year-over-year revenue. The increase was primarily fueled by a 32% rise in gaming revenue. The stark difference between the companies' gaming segments comes from the difference between the gaming PC and console market. Nvidia's gaming revenue is comprised of GPU sales to PC gamers, with a portion made from providing chips to Nintendo's Switch console.

AMD's segment is far more diverse, with revenue coming from PC GPU sales and semi-custom products it provides for consoles such as Microsoft's (NASDAQ: MSFT) Xbox, Sony's (NYSE: SONY) PlayStation, and Valve's Steam Deck. 

In 2021, the Nintendo Switch sold 8.2 million units, while the Xbox Series X|S sold about 8.7 million, and the PlayStation 5 sold 11.5 million. AMD's rise in gaming revenue shows that its ability to diversify the segment has played to its advantage. 

The PC market is in a slump, with multiple tech companies feeling the effects. Despite significant gains in revenue in its second quarter, AMD's Q3 revenue projection of $6.7 billion versus analysts' expectation of $6.81 billion due to decreased PC demand caused its stock to fall 10.2% in August.

However, its gaming segment isn't the only part of its business strengthened by its diversification. While Nvidia's business is 30% gaming and 56.7% data centers, AMD's is a much more evenly split between its four segments. In Q2 2022, AMD's revenue was 22% data centers, 32.8% clients, 25% gaming, and 19% embedded products. 

There is no doubt that Nvidia and AMD have suffered at the hands of the declining PC market. However, AMD seems more capable of propping up its business with its other segments. Nvidia's dependence on PC sales and the volatility in the cryptocurrency market make it a less reliable stock.

Additionally, AMD said in a 2022 earnings call that it had gained market share for nine consecutive quarters, having taken share from Intel, illustrating its growing dominance in the market. Its consistent growth and variety of succeeding segments suggest AMD is the better buy over Nvidia.