AI-driven memory shortages are boosting suppliers while rising costs weigh on hardware makers' margins and outlooks.