Large ships typically rely on a gyrocompass, using the magnetic compass only as a backup.
en.wikipedia.org In addition to the three instruments already used, students were taught to use two gyro instruments, the magnetic compass, the rate-of-climb indicator, and the clock.
en.wikipedia.org It is often part of a ships set of compasses, which also include a conventional gyrocompass and a magnetic compass.
en.wikipedia.org The instrument panel housed fuel pressure, oil pressure and temperature gauges, a clock, altimeter, tachometer, airspeed indicator, bank and turn indicator, and liquid magnetic compass.
en.wikipedia.org There was an automatic pilot function driven by either gyrocompass or magnetic compass as the input heading source.
en.wikipedia.org