San Francisco (CNN Business) Nvidia's first quarter earnings beat projections, sending the chipmaker's stock surging.

Nvidia NVDA On Thursday,reported revenue of $2.22 billion, slightly above analysts' expectations of $2.20 billion. Shares rose over 6% on the news.

Nvidia, which makes high-end graphics chips for devices such as PC gaming systems and self-driving cars, said revenue declined about 31% compared to a year earlier. Its revenue has now fallen for two consecutive quarters.

In January, Nvidia lowered its sales outlook because of China's weakening economy, which led to a decline in the demand for video games.

The decline this quarter was the result of a drop in revenue from graphics processing units, which can also be used to mine cryptocurrencies like bitcoin. When crypto prices took a dramatic plunge, Nvidia was hit hard. Revenue from its data division also declined. Its automotive unit was a bright spot, with revenue up 14% from a year earlier, to $166 million.

Read More