PC chip maker Advanced Micro Devices reported record revenue of $1.65 billion in the second quarter, but it still had a net loss for the period because of a loss related to its ownership in chip manufacturer GlobalFoundries.

In other words, AMD would have made money in the quarter were it not for a $120 million equity loss related to GlobalFoundries. Revenues were $1.65 billion, up 40 percent from a year ago. The company rode the same healthy PC market that lifted Intel’s earnings to record levels in the second quarter.

The GAAP net loss was $43 million, or 6 cents per share, compared with a loss of $330 million, or 49 cents a share a year ago. On a non-GAAP basis, AMD made $83 million, or 11 cents a share, compared to a loss of $244 million, or 37 cents a share, a year ago. Analysts expected revenue of $1.55 billion and non-GAAP net income of 6 cents a share. On a one-time basis, AMD recorded a $120 million loss related to its ownership in GlobalFoundries, which is the former manufacturing arm of AMD that was spun off last year.

Dirk Meyer, chief executive of AMD in Sunnyvale, Calif., said in a conference call that robust demand for mobile chips and solid execution drove the quarterly revenues. During the quarter, AMD added Sony as a microprocessor for the first time in a long while. On top of that, AMD’s existing customers have been expanding their offerings of AMD-based computers. Hewlett-Packard, for instance, widened its use of AMD chips. That’s a big deal because HP is the world’s largest computer maker.

Meyer said that the quarter showed the company can generate (operating) profits while still pursuing its strategic investments in new chips and technologies. The company expects to launch new graphics chips later this year and expects demand for graphics chips to be strong in the second half.

AMD has come a long way from the days when it was always losing money. In that respect, the company’s decision to divide itself in two was a big success. The company has $1.9 billion in cash and used $206 million in the quarter to pay down debt. AMD still has long-term debt of $2.4 billion, so it is still in a fragile state compared to Intel, which is the world’s largest chip maker. Overall, AMD set quarterly records in shipments of graphics chips, mobile graphics chips, mobile microprocessors, and chip sets.

Computing segment revenue increased 31 percent from a year ago. Average prices for microprocessors were flat compared to the first quarter and were up from a year ago. The company says it is on schedule to deliver its Fusion chips, which combine graphics and a microprocessor in a single chip, in the fourth quarter. Fusion chips which are code-named Ontario will ship in the fourth quarter, but computers using it will likely appear early next year. Other Fusion chips, code-named Llano, will appear early next year.

Graphics chip revenue was up 87 percent compared to a year ago, but average selling prices dipped somewhat compared to the first quarter. The graphics business has made a big comeback in the past few years in terms of competition with Intel and Nvidia. In three quarters, AMD said it has shipped 16 million graphics chips that are compatible with Microsoft’s DirectX 11 software. In the coming third quarter, AMD expects revenue to be up on a seasonal basis. AMD now owns 28 percent of GlobalFoundries.

Meyer said that the company’s Vision marketing program has been a big success, with more than 130 computer design wins using it.