Nvidia became the first company to surpass $5 trillion in market value after a fresh rally driven by AI-chip demand.