The investment comes as Musk’s AI unit faces complaints about the carbon-emitting units and looks to become a big player in cloud computing.