You may notice that in the latest nightlies we’ve changed the supported range of NVIDIA hardware and drivers in the out-of-the-box Mojo and MAX packages to be Turing and newer, and NVIDIA driver version 580 and newer. This is prompted by our need to support CUDA 13 for the latest optimizations and bugfixes, as well as to support new hardware like the DGX Spark and Jetson Thor. However, we’ve also added a new opt-in mechanism for providing broader support for older NVIDIA hardware and drivers so that we can expand support for Mojo and MAX in both directions.
As a little background on how compilation to target NVIDIA hardware works in Mojo: when we compile a Mojo function to target an NVIDIA GPU, we use an internal version of libnvptxcompiler to perform the last stage of this compilation to a usable binary. A while ago, we had provided PTX to the driver to just-in-time compile, but found that this led to unpredictable behavior during the first run of models as kernels were compiled on initial use. To avoid the need for multiple warmup runs of a model in order to hit all kernel variants, last year we switched to a more ahead-of-time compilation model using libnvptxcompiler. This gave us better, more predictable first-run performance for models.
However, this tied our support for NVIDIA hardware and drivers to the ones compatible with the specific version of libnvptxcompiler we build Mojo and MAX against. We recently needed to update this to CUDA 13, in order to take advantage of improved compilation and to target new hardware. CUDA 13 is a major update and with it NVIDIA has dropped support for pre-Turing hardware and any NVIDIA driver versions before 580.
To continue to allow Mojo and MAX to be usable on older NVIDIA hardware and driver versions, we have added a new mechanism by which you can use a system-provided ptxas binary instead of our internal libnvptxcompiler. To do so, you’ll need to have installed a CUDA compiler package on your system and then set the environment variable MODULAR_NVPTX_COMPILER_PATH to point to the ptxas binary installed by that package. Note that we require certain PTX versions for various architectures, such as 8.1 for Ampere, and you’ll need to make sure that your version of ptxas can handle that for your target hardware.
The great thing about this new environment variable is that it totally decouples NVIDIA hardware support from what we build into the Mojo compiler, so you should be able to target even older hardware and drivers than we have in the past. This is in addition to the new support for DGX Spark, Jetson Thor, and other new NVIDIA hardware that comes with the CUDA 13 upgrade.