Image source: AMD.

With shares of Advanced Micro Devices (AMD -2.69%) near their highest level in years, it can be easy to forget that the company is still unprofitable. In 2015, AMD posted a whopping $660 million net loss, its fourth annual net loss in a row. The situation has improved this year, with AMD managing to squeeze out a non-GAAP operating profit during the second quarter. But a return to true profitability remains elusive.

What will it take for AMD to turn a profit? Revenue, and lots of it.

Cost-cutting isn't enough

AMD's revenue tumbled 27.5% in 2015, driven by sluggish demand for PCs and share losses to NVIDIA in the GPU market. Through the first six months of 2016, AMD has produced $1.86 billion of revenue, down from $1.97 billion during the same period last year. Cost-cutting has helped keep operating losses in check despite the lower revenue, but increasing sales is the only path to sustainable profitability.

One thing that has acted as a barrier to profitability for AMD is its debt load. During the first six months of 2016, AMD paid $81 million in interest on about $2.2 billion of debt. In 2015, interest payments ate up 4% of revenue, meaning that the company would have needed to deliver an operating margin of 4% just to break even after interest.

The good news for AMD is that its recently announced stock and convertible note sale, which is expected to raise more than $1 billion in total, will allow the company to pay down some of its debt and reduce its annual interest obligations. The surge in the stock price this year created an opening for AMD to raise cash, and the company took full advantage. This alone won't be enough to propel the company back to profitability, but it's a good move nonetheless.

More revenue is coming

AMD expects to grow total revenue by a low-single-digit percentage this year, but that won't be enough to return the company to profitability. Over the next few years, a few things will need to go right for AMD in order for the company to bring in enough revenue to pull the bottom line back into the black.

First, AMD's semi-custom business will need to secure sufficient revenue beyond gaming consoles. Both the number of consoles sold and the amount of revenue AMD receives per console will decline as this generation matures, creating a hole that the company will need to fill. AMD has already announced three design wins -- one of which is Microsoft's Project Scorpio console -- that are expected to bring in a total of $1.5 billion over the next three to four years. That's a good start, but AMD will need to keep winning deals in order to drive meaningful growth in the long run.

Second, AMD will need to win back graphics market share from NVIDIA. The company has already launched its mainstream Polaris graphics cards, and with NVIDIA mainly focused on the high end, there's a good chance that AMD is picking up mainstream customers. How much additional revenue this will create remains unclear, though. We'll need to wait until AMD reports its third-quarter results later this month to find out.

Third, AMD's upcoming Zen CPUs, set to launch next year for PCs and servers, will need to find a way to claw back market share from Intel. As long as Zen proves competitive, AMD has a decent shot at making progress. Intel has slowed the pace at which it moves to new manufacturing processes, meaning that the manufacturing gap between Intel and AMD will be narrower than it's been in quite some time. As long as Zen doesn't fail to live up to expectations, AMD has a good chance at winning back at least some market share.

If things go right for AMD, the company could conceivably return to profitability next year or in 2018. But an important follow-up question is this: Can AMD produce enough profits to justify its soaring stock price? With a market capitalization of around $5.4 billion, AMD will likely need to sustainably produce a few hundred million dollars of profit annually to keep its stock afloat. AMD has done it before, but the good times have never lasted for more than a few years. Will this time be different? Only time will tell.