Rust-GPU/rust-cuda

Support for CUDA 12.0 (libnvvm 2.0)

n4o847 opened this issue · 3 comments

Hello.

I just upgraded to CUDA 12.0 and I am getting the following error in cuda_builder:

error: rustc_codegen_nvvm requires at least libnvvm 1.6 (CUDA 11.2)

This seems to be because CUDA 12.0 uses libnvvm 2.0, which is incompatible with version 1 1 2, and the version check fails.

Is there any plan to support CUDA 12.0? Thanks in advance!

Environment

  • Ubuntu 22.04
  • Rust nightly-2021-12-04 (the same version as this repository)
  • CUDA 12.0
  • LLVM 7.1.0

Footnotes

  1. https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html

  2. https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html

We've just finished updates to a more recent rust toolchain. In my workspace, I've been using 12.8 with libnvvm 2.0, and have changed the line here to bypass that check 🤣

I'm not sure what issues this might cause with either the codegen or the cust/cuda crates today, but for now it seems to "just work".

It doesn't look the libnvvm API was breaking, and I don't think there is any case where we can generate multiple versions concurrently. We don't appear to support the addresspace intrinsics they removed, and there is a reference to addrspacecast in the codebase which is what they suggest using. We don't support pragma unroll, which changed in 2.0.

The only one I am concerned about is:

Shared variable initialization with non-undef values is no longer supported. In 1.x versions these initializers were ignored silently. This feature makes the 2.0 version incompatible with 1.x versions.

But I doubt it would be an issue unless you are mixing and matching.

So let's closed this as fixed and deal with any issues in follow-up bugs 🚀