NVIDIA / NVIDIA/cuda-quantum

Include location information with the QIR verifier error message

Open
#3,323 2 comments 0 reactions 1 assignee View on GitHub

@sacpis is already working on this.

Since Aug 8, 2025.

stale-notified
Dominant language
C++
Stars
1.1k
Forks
456
Avg merge
1d 22h
Merged PRs (30d)
165

Description

A kernel such as this:

qpu void kernel(int var1, int var2) {
int local = 0; // this is fine
int a = var1;
int b = var2;
int c = std::min(a, b); // this is the offending line

return;
}

When used with a hardware platform as the target, will throw an error with the following message error - invalid instruction found in adaptive QIR profile: %0 = alloca i32, align 4. The likely cause is the stack allocation triggered by the std::min call.

However, it is not clear from the error message which line of the kernel caused the error. Would be very helpful to include the location information in the QIR error message to aid debugging.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.