Nvidia topped earnings expectations, citing surging demand amid heightened interest in artificial intelligence.