You can tell which type of DVI cable you need based on the pattern of pins on the port/plug. Make sure you’re accounting for the pin number as well as the cable format (analog, digital, integrated).
Any DVI plug can go into a dual-link DVI-I port, but only a single-link DVI-A plug can go into a single-link DVI-A port.
For more information, refer to the “Plug-In Compatibility” section of the article.