NVIDIA (NVDA -1.72%) stock has been a dynamo over the course of the past year, gaining nearly 140%. Shares of the graphics processing unit (GPU) pioneer set fresh all-time highs prior to the COVID-19 pandemic. The company got an additional boost as gamers forced into exile at home turned to their favorite pastime. This sent the stock rocketing even higher, gaining an incredible 1,600% over the past five years.

This has many investors wondering if the train has already left the station or if NVIDIA still has room to run. Let's take a look at what has been driving the stock in an attempt to answer the key investing question: Should you buy NVIDIA stock right now?

NVIDIA GeForce GTX 670 processor.

Image source: NVIDIA.

Shaking off COVID-19

Many industries were well-positioned to ride out the government-mandated stay-at-home orders caused by the coronavirus pandemic, including the video game sector. In April, worldwide spending on digital games hit a record $10.5 billion, according to Nielsen-owned SuperData. That came on the heels of the $10 billion record set in March. 

As the processor of choice for hardcore gamers and the industry-leading provider of GPUs, NVIDIA was uniquely positioned to benefit from the time gamers spent at home. However, while its video game segment provides the lion's share of NVIDIA's sales, it isn't the only growth driver.

The cloud computing advantage

The GPU was originally designed to perform the complex mathematical calculations necessary to render realistic graphics. Parallel processing -- the GPU's ability to execute multiple calculations simultaneously -- also turned out to work well in artificial intelligence (AI) applications as well as in cloud computing and data centers.

In fact, NVIDIA GPUs power the data center of every major player in cloud computing, including Amazon, Microsoft, Alphabet, and Alibaba

The company has also invested heavily in developing integrated hardware and software solutions that fast-track AI applications, so they're up and running in hours instead of weeks months.

Recent results tell the tale

NVIDIA's already robust results were supercharged as the pandemic unfolded. First-quarter revenue grew to $3.08 billion, up 39% year over year, while earnings per share of $1.47 soared 130%.

The rock-solid results were driven primarily by the gaming segment, which climbed 27% and generated 43% of the company's sales. Yet perhaps more important was the data center segment, which includes chips sold for AI, cloud computing, and data center applications. Revenue climbed 80% to a record $1.14 billion, while also generating more than $1 billion in quarterly revenue for the first time.

A man working on a tablet producing a cloud computing image and various graphs.

Image source: Getty Images.

A word on valuation

NVIDIA stock is by no means cheap. As of Wednesday's market close, the stock trades at more than 46 times forward earnings, and an only slightly more reasonable 16 times forward sales -- easily falling within the definition of high valuation. Investors have clearly baked a great deal of future growth into the company's current share price.

Those numbers are frothy, even considering that analysts expect sales to grow 31% in the current quarter, 34% for the current year, and 17% next year. Still, NVIDIA has a history of surpassing analysts' expectations, so those numbers may turn out to be conservative.

How to decide

This brings us back to the first investing question, "Should you buy NVIDIA stock right now?" As with so many things, the answer is: "It depends."

If you are an investor who simply can't stomach a nosebleed-inducing valuation and are waiting for something slightly more reasonable, NVIDIA probably isn't for you. The company has a long and sordid history of high valuations, with only brief intervals in which it was considered anything even close to "cheap."

If, on the other hand, you'll accept a lofty valuation and sticker price for a stock that's riding powerful forward-looking trends and that presents an impressive opportunity for future growth, then NVIDIA might be a good fit for your portfolio.