Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing CUDA-Q using the script does not work #2508

Open
3 of 4 tasks
diehlpk opened this issue Jan 14, 2025 · 2 comments
Open
3 of 4 tasks

Installing CUDA-Q using the script does not work #2508

diehlpk opened this issue Jan 14, 2025 · 2 comments

Comments

@diehlpk
Copy link

diehlpk commented Jan 14, 2025

Required prerequisites

  • Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
  • Make sure you've read the documentation. Your issue may be addressed there.
  • Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
  • If possible, make a PR with a failing test to give us a starting point to work on!

Describe the bug

After installing CUDA-Q, I can not compile one of the examples.

I copied the code from here to the file text.cxx

// Compile and run with:
// ```
// nvq++ cuquantum_backends.cpp -o dyn.x --target nvidia && ./dyn.x
// ```

// This example is meant to demonstrate the cuQuantum
// GPU-accelerated backends and their ability to easily handle
// a larger number of qubits compared the CPU-only backend.

// On CPU-only backends, this seems to hang, i.e. it takes a long
// time to handle this number of qubits.

#include <cudaq.h>

// Define a quantum kernel with a runtime parameter
struct ghz {
  auto operator()(const int N) __qpu__ {

    // Dynamically sized vector of qubits
    cudaq::qvector q(N);
    h(q[0]);
    for (int i = 0; i < N - 1; i++) {
      x<cudaq::ctrl>(q[i], q[i + 1]);
    }
    mz(q);
  }
};

int main() {
  auto counts = cudaq::sample(/*shots=*/100, ghz{}, 28);

  if (!cudaq::mpi::is_initialized() || cudaq::mpi::rank() == 0) {
    counts.dump();

    // Fine grain access to the bits and counts
    for (auto &[bits, count] : counts) {
      printf("Observed: %s, %lu\n", bits.data(), count);
    }
  }

  return 0;
}

and get the following error:

 /vast/home/diehlpk/Compile/cudaq/bin/nvq++ --target nvidia test.cc -o test.x
Could not find a valid clang resource-dir.

Steps to reproduce the bug

Install CUDA-Q using ./install_cuda_quantum_cu12.aarch64 --accept --target ./cudaq and use the installed nvq++ compiler.

Expected behavior

The example should compile.

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment

  • CUDA-Q version:
  • Python version:
  • C++ compiler:
  • Operating system:

Suggestions

No response

@bmhowe23
Copy link
Collaborator

Hi @diehlpk - thank you for using CUDA-Q. According to the docs (quoted below), admin privileges are required to install CUDA-Q using the installer method that you described above. When you installed it, did you have admin privileges?

The installation location of CUDA-Q is not currently configurable and using the installer hence requires admin privileges on the system. We may revise that in the future; please see and upvote the corresponding GitHub issue.

If you do not have admin privileges, you can often use our Docker image (either through the Docker daemon or through Singularity as described on the aforementioned webpage). Do those options work for you? In either case, you may want to comment on issue #1075.

@diehlpk
Copy link
Author

diehlpk commented Jan 14, 2025

@bmhowe23 I do not have root access on our Grace Hopper cluster and tried to install into user space. I do not want a system wide installation yet since I explore the software. Containers are not an option yet. I tried to install from source but that failed as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants