Nvidia Drivers & Compilers

Compilers may generate binary machine-code for Nvidia GPUs directly. Or they may compile to an intermediate language, and then the CUDA run-time performs the final step of converting to machine-code.

In terms of features, each Nvidia GPU generation is a superset of its predecessors. The intermediate language used to address them, PTX (Parallel Thread eXecution), has features added, but never removed. So a compiler can produce PTX suitable for an ancient graphics card, and the CUDA run-time will be able to convert that to machine-code (cubin, CUda BINary) suitable for the latest GPU. The reverse is not true. PTX using all the latest features cannot be compiled into something for an old card. The start of a PTX file will state the lowest version with which it is compatible, and the final compilation for the card is performed by libnvidia-ptxjitcompiler.so from Nvidia's CUDA distribution.

This is quite a flexible scheme. When Nvidia releases a new card, it need not be binary compatible with the previous generation. Provided that Nvidia also provides a new PTX JIT compiler, then all existing executables which contain PTX sections will run on the new card. They will not use any new features that the new card introduces, but, apart from that, they should run almost optimally.

GCC uses the PTX route. Nividia's compilers tend to compile directly to cubin.

Those using Nvida cards will be familiar with `CC' or `SM' numbers. `CC' refers to `Compute Capability', and `SM' to `Streaming Multiprocessor'. These numbers are trivially related, in that the CC number is ten times the SM version. However, PTX version numbers are different, as are CUDA version numbers. So too are driver version numbers.

I believe that for a working system the inequalities are:

Unfortunately, and inevitably, recent versions of CUDA have started dropping support for older cards. CC versions prior to 50 are very unlikely to be supported on a current (2025) system, and prior to 60 quite unlikely. A CC of 75 is a useful minimum.

It is possible for a program to contain muliple PTX sections with different versions, so as to produce wide compatibility whilst also making use of new features on newer cards. It is also possible to compile all the way to a CUDA binary or `cubin'. This will produce faster application start-up times. It is even possible to include a cubin section as an alternative to a PTX section. Otherwise, if faced with a newer GPU, the code will fail as cubins need to match their target exactly.

It is also possible to produce PTX code which works on a specific family, or a specific architecture, only. For the nvcc compiler, the distinction is between architectures of sm90 (all cards with compute capability 9.0 or greater), sm90f (all cards with compute capability 9.X) and sm90a (cards with compute capability exactly 9.0).