change NoDeviceError back to RuntimeError