cuda-quantum icon indicating copy to clipboard operation
cuda-quantum copied to clipboard

Including cupy in the latest-hpc image

Open poojarao8 opened this issue 2 years ago • 2 comments

A lot of applications require using a linear system solve (using cupy) to create the initial quantum state. On systems like NERSC, it's hard to install anything new in the container as you are creating a new instance for every run. Since cupy is a scalable gpu enabled library, it would be great to have it latest-hpc image.

poojarao8 avatar Sep 22 '23 20:09 poojarao8

I would also like to see this please

zohimchandani avatar Jan 10 '24 11:01 zohimchandani

cupy can be installed in user-mode (--user) inside the container. On systems like NERSC, the installed package is mounted to user's directory, thus will be persisted between container launches.

Note: always install the prebuilt cupy wheel for a particular CUDA version (cupy-cuda11x) since the CUDA-Q docker image doesn't have all the dependencies to build cupy from source.

Reproduce steps for NERSC:

  • One time installation
shifter --image=docker:nvcr.io/nvidia/nightly/cuda-quantum:latest --module=cuda-mpich /bin/bash
python3 -m pip install cupy-cuda11x --user
  • Check package persistent: exit shifter then relaunch; cupy should still be available, e.g., the below Python script should work.
import cupy
print(cupy.cuda.runtime.getDeviceCount())

1tnguyen avatar Jul 23 '24 02:07 1tnguyen