The stocks of chip companies Advanced Micro Devices (AMD 1.33%) and NVIDIA (NVDA 3.71%) have been on the rise over the past year, with the former up roughly 90% and the latter up some 160%. Which of these two archrivals looks like the best buy now? Let's take a look.

Side view of AMD's Vega Frontier Edition graphics processor.

VEGA FRONTIER EDITION GPU. IMAGE SOURCE: ADVANCED MICRO DEVICES INC.

Advanced Micro Devices

After long being dominated by Intel and NVIDIA, AMD has had a strong start to 2017. AMD received a lot of attention for several new product launches, including its new Ryzen CPUs, Vega GPUs, and its new Epyc chip for servers. These new chips offer a competitive value proposition, and investors are clearly optimistic about AMD's prospects.

In the second quarter, AMD's computing and graphics segment, which comprises sales of Ryzen and Vega chips, had a 51% increase in revenue year over year. For the full year, management expects to finally turn a profit after years of losses. Revenue is expected to be up around 15% or more, with gross margin expanding above last year's 31%.

Metric 2016 2015 2014 2013 2012
Revenue $4,272 million $3,991 million $5,506 million $5,299 million $5,422 million
Net loss $497 million $660 million $403 million $83 million $1,183 million

DATA SOURCE: AMD. 

At a forward price-to-earnings ratio of 130 times analyst estimates for 2017, investors are making a big bet that AMD is going to make a big comeback in the CPU market with its new Ryzen processors. Intel has led this market since around 2006, with its market share reaching over 80%. However, according to Passmark's latest benchmarking data, AMD gained about 10% share versus Intel since the end of 2016, which is a good sign that recent innovations are paying off.

AMD could pick up even more share in the short term in both CPU and GPU markets. Mobile versions of Ryzen will be launching soon. Also, Vega GPUs just started shipping around the beginning of the third quarter, which will give NVIDIA stiffer competition in the short term. The latest data from Jon Peddie Research shows AMD's discrete GPU market share ticked up to 29.4% for the second quarter while NVIDIA's ticked down a few points to 70.6%.

Another opening for AMD could come from the fast-growing data center market, in which NVIDIA has been growing revenue more than 100% in recent quarters. AMD's recent partnership with Baidu shows that there is demand for companies that can provide both CPU and GPU solutions, which puts AMD in a unique position compared to Intel and NVIDIA, since only AMD can claim expertise developing both CPU and GPU technology.

A man playing a video game on his desktop computer.

Image source: Getty Images.

NVIDIA

NVIDIA is the pioneer of the GPU. For nearly 20 years, it has been catering to the needs of PC gamers, who make up 57.5% NVIDIA's total revenue over the trailing-12-month period.

Metric 2017 2016 2015 2014 2013
Revenue $6,910 million $5,010 million $4,682 million $4,130 million $4,280 million
Net income $1,666 million $614 million $631 million $440 million $563 million

DATA SOURCE: NVIDIA. FISCAL YEARS SHOWN. 

NVIDIA launched its latest Pascal GPUs last year, which helped extend its market share lead to as high as 72.5% earlier this year. AMD's new offerings will provide a compelling alternative in the short term, but it's uncertain how much more share AMD can take away, since NVIDIA just announced its latest chip design, Volta, which will take GPU performance to another level. As AMD rolls out Vega chips, NVIDIA will likely announce new gaming GPUs based on Volta in the coming months, which may halt the advance AMD makes on NVIDIA's turf.

NVIDIA doesn't always offer the best value, but it has done a better job than AMD at developing GPUs that deliver high performance while requiring lower amounts of power. This helps neutralize AMD's pricing advantage, because graphics cards with higher wattage requirements may require a gamer to pay for a new power supply in addition to the new graphics card, which adds to the expense of upgrading.

Additionally, NVIDIA has been very successful finding new applications for its core graphics processing technology in other industries, which loosens NVIDIA's dependence on the cyclical nature of the gaming segment. NVIDIA has a roster of partnerships with just about every major automaker to help build a fully autonomous car in the next five years.

Which is the better buy?

NVIDIA's consistent financial performance has allowed it to build a significant advantage over its rival. At the end of the second quarter, AMD had $531 million in net debt, while NVIDIA had $3.9 billion in net cash. In a historically cyclical and fast-changing competitive landscape like computer chips, the importance of having a major cash cushion cannot be emphasized enough.

As for valuation, NVIDIA's forward P/E ratio of about 50 is much more attractive than AMD's 130 times forward earnings. Plus, NVIDIA shareholders get a dividend yield of 0.31%, which is not much, but better than no dividend from cash-strapped AMD.

AMD has upped its game, but for investors looking for the stock with the best risk-to-reward potential, NVIDIA looks like the better choice.