Nvidia is riding high after another quarter of blockbuster sales and earnings, even as threats are emerging that could weaken the company’s position at the center of the artificial-intelligence boom.