US stocks end higher with Nvidia leading tech gains