(Reuters) - Advanced Micro Devices Inc AMD.O beat estimates for quarterly profit and revenue on Wednesday, as a rare surge in demand for personal computers boosted sales of its processors, graphic chips, sending its shares up 5 percent in extended trading.

FILE PHOTO: A man looks at motherboards displayed at the AMD booth during the Computex 2011 computer fair at the TWTC Nangang exhibition hall in Taipei May 31, 2011. REUTERS/Pichi Chuang/File Photo

The company’s shares have more than doubled in the past two years on continued demand for graphic chips used in computers, videogame consoles and a variety of other applications.

AMD said sales in its graphics and computing business, which makes processors for servers and gaming consoles, rose 64 percent to $1.09 billion, primarily driven by its Ryzen desktop processors and Radeon graphic cards.

However, it declined 3 percent quarter-over-quarter, primarily due to lower revenue from graphic processing units (GPU) in the blockchain market.

AMD’s gross margins also grew 3 basis points to 37 percent. The company said its GPU average selling price increased due to Radeon and sales to data centers.

“We think investors are focused on AMD’s gross margin expanding as a measure of success of its new products,” Stifel analyst Kevin Cassidy said.

The increase in average selling price of GPUs also helped offset fears of weak cryptocurrency-related demand, Cassidy added.

In recent years, AMD like rival Nvidia Corp NVDA.O, has been riding the bitcoin wave despite a downward spiral in cryptocurrency prices on fears of regulatory scrutiny. GPUs provide the high computing abilities required for cryptocurrency mining.

Graphics cards used by cryptocurrency miners accounted for about 6 percent AMD’s overall sales from 10 percent last quarter, the company’s CFO Devinder Kumar said on a post-earnings call.

The company also profited from its EPYC server processors gaining market share amid a largely stabilizing PC market. During the quarter, worldwide PC shipments grew for the first time in six years, according to research firm Gartner.

AMD reported a net income of $116 million, or 11 cents per share, in the second quarter ended June 30, compared to a loss of $42 million, or 4 cents per share, a year earlier.

This was the company’s highest quarterly net income in seven years, AMD said.

Excluding items, the company earned 14 cents per share, beating the analysts’ average estimate by 1 cent, according to Thomson Reuters I/B/E/S.

Revenue rose 53 percent to $1.76 billion, marginally topping estimates of $1.72 billion.

For the third quarter, AMD forecast revenue of about $1.7 billion, plus or minus $50 million. Analysts had expected revenue of $1.76 billion.