Nvidia, the world’s largest company, began outperforming rival Advanced Micro Devices in early July.