Nvidia (NVDA -0.62%) has done a lot over the past five years. Five years ago, it was nearing the bottom of a cycle thanks to a collapse in the cryptocurrency market. Now, it's reaching new highs as its graphics processing units (GPUs) are in high demand for creating artificial intelligence (AI) models.

While it would have been nearly impossible to predict all of the places Nvidia has gone over the past five years, I'm going to speculate on where it could go in the next five years. Although this prediction will likely be wrong in some ways, it's good at least to develop an investment thesis for the market's most dominant company right now.

Nvidia's best-in-class GPUs are about to face some competition

Nvidia's GPUs are -- hands down - the best in class. There's a reason why all of the biggest companies that provide the tools to make AI models or create them in-house are using Nvidia GPUs nearly exclusively. However, that exclusivity may be dwindling.

Because GPUs can do multiple calculations in parallel, they are fantastic for creating AI models. However, if the only thing that the GPU will be doing is training AI models, more efficient hardware is available. For instance, Google Cloud's tensor processing unit (TPU) is more effective at training AI models than a GPU if the workload is set up to be run on a TPU.

This still leaves a use case for GPUs, which are fantastic for running initial models. However, custom-designed AI chips like TPUs can exceed the performance of GPUs when they are used for a specific purpose.

Google Cloud isn't the only one creating these custom chips. Amazon Web Services, Microsoft Azure, and Meta Platforms are also creating their own custom-designed chips. This could present a problem for Nvidia over the next five years, as many of its largest customers are bringing these designs in-house. Demand for Nvidia GPUs will still likely be high, but it may not be as high as it is now.

On the plus side for Nvidia, all of the record-setting number of GPUs it has sold over the past year will eventually need to be replaced. While there is no hard and fast rule, it's common for these GPUs to last between three and five years in a data center. After that, they'll either need to be replaced (whether by some in-house design or Nvidia's latest product) or decommissioned.

The computing power to run these models continuously isn't going away, so decommissioning these GPUs isn't an option. This will create essentially a long-term subscription effect, and five years from now, Nvidia will likely see another wave of replacing the products it is selling right now.

That's not to mention all of the technological improvements that will likely be made from now until then, as new chip technology (like Taiwan Semiconductor's 2-nanometer chip technology that will be more efficient than the previous generation) will create more powerful and efficient GPUs that will help its users out over the long run.

But is all of that already baked into the stock price?

Nvidia's profit margins are ripe for competition

It's no secret that Nvidia's stock is expensive. The shares trade at 73 times trailing and 46 times forward earnings, which means significant growth is already priced into the stock.

However, Nvidia's record margins are not often discussed. Nvidia's near-60% profit-margin levels are unbelievable and are a primary reason why many companies are starting to design their chips in-house.

NVDA Gross Profit Margin (Quarterly) Chart

NVDA Gross Profit Margin (Quarterly) data by YCharts.

Because demand for Nvidia's GPUs is so high right now, the company can afford to charge a premium for its products. Eventually, that won't be the case, and its profit margins will likely fall over the next five years.

When that happens, its price-to-earnings (P/E) ratio will increase due to earnings either growing at a slower pace or falling. This is a huge risk associated with the stock, as the market believes Nvidia's revenue will keep going straight up forever.

While demand for Nvidia's products will likely remain elevated, don't be surprised when Nvida faces challenges with in-house solutions in the next few years. There's an old saying that a company's margins are a competitor's opportunity, and when Nvidia's margins reach these levels, there's bound to be competition soon.

As a result, Nvidia's stock may face some pressure over the next five years. This unbelievable demand boom won't last forever, and the opportunity is just too large for every company to sit still and watch Nvidia take their money.