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