Skip to content

Is it possible to provide a LLVM independent build? #229

Open
@Neutron3529

Description

@Neutron3529

I tried to publish another cuda crate without llvm or specific rust compiler support:

https://github.com/Neutron3529/cuda_min

Such crate works very well, and thus I have some doubt: why a specific llvm version and rust version is needed?

It seems that

  1. llvm-bitcode-linker could compile rust code into PTX
  2. nvidia driver could load PTX code directly. (no need to install cudart, nvidia's driver provides interfaces such as cuInit.)

I just wonder why a specific llvm version even a specific rustc version is required. We should have the ability to compile a cuda program easier.

Activity

LegNeato

LegNeato commented on Jul 1, 2025

@LegNeato
Contributor

@brandonros did some experiments with emitting llvm ir and then using llvm-bitcode-linker I believe. Care to comment on if this path is viable?

brandonros

brandonros commented on Jul 1, 2025

@brandonros

@LegNeato I did not feel there was a lot of good warm than reception on that approach.

This repo is really cool because you are taking over somebody's extremely hard to do rustc_codegen approach from LLVMv7

Is there any appetite to consider alternatives?

I get that Blackwell is very early and a very small piece of the market, but if we are forward looking, I would guess that within the next two years, the majority of the market will be using this new LLVM v19 version of NVVM/etc

I would like to sync with you on this, I am sure you were busy, but I basically came up with two different approaches

One of them is the one that I PR'd where I fumbled through making a new rustc_codegen

Another is where I give up a ton of flexibility related to address space but I was able to do LLVM IR -> NVVM which I would really like to show you and get some feedback on whenever you have time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @LegNeato@brandonros@Neutron3529

        Issue actions

          Is it possible to provide a LLVM independent build? · Issue #229 · Rust-GPU/Rust-CUDA