NVIDIA / cuQuantum

Home for cuQuantum Python & NVIDIA cuQuantum SDK C++ samples
https://docs.nvidia.com/cuda/cuquantum/
BSD 3-Clause "New" or "Revised" License
320 stars 63 forks source link

Using cuQuantum Appliance 23.03 with Apptainer/Singularity #76

Closed mtjrider closed 10 months ago

mtjrider commented 11 months ago

I see. I am using the cuquantum-appliance-23.03 and this is my workflow to recreate this issue:

$ apptainer pull docker://nvcr.io/nvidia/cuquantum-appliance:23.03

Then create a file ghz.py as in the documentation, run the container and execute the file

$ apptainer shell --nv -B $PWD cuquantum-appliance_23.03.sif
$ python ghz.py

Traceback (most recent call last):
  File "ghz.py", line 2, in <module>
    from cusvaer.backends import StatevectorSimulator
  File "/scratch/jookare/ghz.py", line 2, in <module>
    from cusvaer.backends import StatevectorSimulator
ModuleNotFoundError: No module named 'cusvaer.backends'; 'cusvaer' is not a package

Originally posted by @Jookare in https://github.com/NVIDIA/cuQuantum/discussions/50#discussioncomment-6603064

mtjrider commented 11 months ago

@jookare can you please try this?

$ apptainer shell --nv cuquantum-appliance_23.03.sif
...> which python

And then separately try this:

apptainer exec --nv cuquantum-appliance_23.03.sif which python

Please paste the output here.

Jookare commented 11 months ago

Thanks for creating a new issue for me. Here are the things you requested

[jookare@r17g05 cuQuantum]$ apptainer shell --nv cuquantum-appliance_23.03.sif
Apptainer> which python
Illegal option --
Usage: /usr/bin/which [-a] args
[jookare@r17g05 cuQuantum]$ apptainer exec --nv cuquantum-appliance_23.03.sif which python
/home/cuquantum/conda/envs/cuquantum-23.03/bin/python
mtjrider commented 11 months ago

Now, instead of shell can you try run?

The exec command picks up the correct Python.

Jookare commented 11 months ago

Still the same

[jookare@r17g05 cuQuantum]$ apptainer run --nv cuquantum-appliance_23.03.sif
...tons of text...
Apptainer> which python
Illegal option --
Usage: /usr/bin/which [-a] args
mtjrider commented 10 months ago

@Jookare sorry it took me awhile to get back to this issue.

This call signature appears to be the only one that works: apptainer exec --nv cuquantum-appliance_23.03.sif ...

The others aren't loading the appropriate runtime. Can you use this call signature for your application?

mtjrider commented 10 months ago

@Jookare let us know if this is still an issue.

Jookare commented 10 months ago

@Jookare let us know if this is still an issue.

Hi sorry for the late reply! I was interning previously and as it ended so I do not have access to the HPC systems anymore and unfortunately can't test anymore

mtjrider commented 10 months ago

@Jookare I've closed this issue. If the issue resurfaces, or you have other questions, please feel free to reopen it or a create another issue.