U.S. stocks rose and erased their losses for the week so far, as Nvidia and other technology companies led the way.