<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Stephan,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I've tried it on the interactive console you described (outside of my virtual environment), and it seems to be working just fine.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Many thanks,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Andrew</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Stephan Oepen <oe@ifi.uio.no><br>
<b>Sent:</b> 11 May 2019 22:59<br>
<b>To:</b> Andrew Dyer<br>
<b>Cc:</b> infrastructure@nlpl.eu<br>
<b>Subject:</b> Re: [NLPL Task Force (A)] Trouble with using GPU in Cupy package</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">yes, if you are running some software that requires CUDA, typically<br>
you need to 'module load' the right version of CUDA first.  but some<br>
modules autoload their dependencies, including the CuPy installation i<br>
made.  i appears you are missing the initial 'module use' command, to<br>
actually activate the NLPL collection of modules.  please see:<br>
<br>
<a href="http://wiki.nlpl.eu/index.php/Infrastructure/software/catalogue">http://wiki.nlpl.eu/index.php/Infrastructure/software/catalogue</a><br>
<br>
so, to try out 'my' CuPy installation, you would have to<br>
<br>
$ module use -a /proj*/nlpl/software/modulefiles/<br>
$ module purge; module load nlpl-cupy<br>
$ type python3<br>
python3 is /projects/nlpl/software/cupy/5.4.0/bin/3.7/python3<br>
<br>
but maybe your private installation actually works fine now, if you<br>
pre-load the right CUDA version?  even if so, i would of course also<br>
be curious to know whether the NLPL installation is functional, in<br>
case others might want to use it ...<br>
<br>
cheers, oe<br>
<br>
On Sat, May 11, 2019 at 10:26 PM Andrew Dyer<br>
<Andrew.Dyer.6854@student.uu.se> wrote:<br>
><br>
> Hi Stephan,<br>
><br>
> Thanks for this.<br>
><br>
> I hadn't module loaded Cuda in my scripts.  I'm going back and looking through some of the instructions now.  So I guess when using CUDA, it is required to module load cuda/[version]?  I've done as follows:<br>
><br>
> module load cuda/8.0<br>
> module load nlpl-cupy<br>
><br>
> When I try module load nlpl-cupy I get the following message:<br>
><br>
> ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'nlpl-cupy'<br>
><br>
><br>
> When I use module -h avail I also don't see nlpl-cupy there.<br>
><br>
> However, despite that error message it seems (going by my slurm output) that the problem is no longer cupy failing to connect to the CUDA:<br>
><br>
> -bash-4.1$ cat slurm-26960146.out<br>
><br>
> ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'nlpl-cupy'<br>
><br>
> Traceback (most recent call last):<br>
><br>
>   File "/usit/abel/u1/andidyer/vecmap/map_embeddings.py", line 422, in <module><br>
><br>
>     main()<br>
><br>
>   File "/usit/abel/u1/andidyer/vecmap/map_embeddings.py", line 148, in main<br>
><br>
>     trg_words, z = embeddings.read(trgfile, dtype=dtype)<br>
><br>
>   File "/cluster/home/andidyer/vecmap/embeddings.py", line 35, in read<br>
><br>
>     matrix[i] = np.fromstring(vec, sep=' ', dtype=dtype)<br>
><br>
> ValueError: could not broadcast input array from shape (125) into shape (300)<br>
><br>
><br>
> So something is obviously going right!<br>
><br>
> Again, many thanks for your assistance.<br>
><br>
> Best wishes,<br>
><br>
> Andrew<br>
><br>
> ________________________________<br>
> From: Stephan Oepen <oe@ifi.uio.no><br>
> Sent: 09 May 2019 18:17<br>
> To: Andrew Dyer<br>
> Cc: infrastructure@nlpl.eu<br>
> Subject: Re: [NLPL Task Force (A)] Trouble with using GPU in Cupy package<br>
><br>
> hi andrew,<br>
><br>
> it appears your local cupy installation is somewhat unable to find its<br>
> external dependencies.  have you 'module load'ed the right CUDA<br>
> version?  are you sure it ended up running on a gpu node?<br>
><br>
> this things can be tricky to sort out, what with the many different<br>
> (and mutually incompatible) module versions available on a large and<br>
> old system like Abel.<br>
><br>
> CuPy looks like a relevant tool for the NLPL software inventory, so i<br>
> installed it as an NLPL module.  the following (when running on a gpu<br>
> node) appears to work:<br>
><br>
> [oe@compute-19-1 ~]$ module purge; module load nlpl-cupy<br>
> module list<br>
> [oe@compute-19-1 ~]$ module list<br>
> Currently Loaded Modulefiles:<br>
>   1) intel/2019.0             4) gcc/4.9.2                7)<br>
> nlpl-cython/0.29.3/3.7<br>
>   2) openssl.intel/1_1_1      5) cuda/9.0                 8)<br>
> nlpl-scipy/201901/3.7<br>
>   3) python3/3.7.0            6) nlpl-numpy/1.16.0/3.7    9) nlpl-cupy/5.4.0/3.7<br>
> [oe@compute-19-1 ~]$ python3 -c "import cupy; print(cupy.__version__);"<br>
> 5.4.0<br>
><br>
> in general, i would suggest testing things interactive first, before<br>
> you invest the time in putting a job in the queue.  these past few<br>
> days, it appears there can be fairly long wait times for gpu nodes on<br>
> Abel (we are really looking foward to transitioning to the new system<br>
> after the summer).  but in principle, one can create an interactive<br>
> session on a gpu node as follows:<br>
><br>
> qlogin --account=nn9447k --time=00:30:00 --mem-per-cpu=2048M<br>
> --partition=accel --gres=gpu:1<br>
><br>
> please see whether the new NLPL version of CuPy works for you (but<br>
> please make sure there are no unwanted interactions with your local<br>
> virtualenv)?<br>
><br>
> best wishes, oe<br>
><br>
><br>
> On Mon, May 6, 2019 at 2:27 PM Andrew Dyer<br>
> <Andrew.Dyer.6854@student.uu.se> wrote:<br>
> ><br>
> > Hi,<br>
> ><br>
> > Apologies for the bother.  I'm currently trying to run an experiment using GPU nodes in Abel.  The Python program that I am using uses Cupy, which I have installed in my venv with pip.  On my sbatch script, I set the GPU request as instructed on the Job
 Scripts page:<br>
> ><br>
> > #SBATCH --partition=accel --gres=gpu:1<br>
> ><br>
> > However, the program that I'm using seems to be having trouble connecting to the CUDA software.  I've checked that the versions match (8.0).  I'm at a loss for what else to do though, so any help you can provide would be appreciated.<br>
> ><br>
> > For reference, see attached my script and the error message in the slurm output.<br>
> ><br>
> > Many thanks,<br>
> ><br>
> > Andrew<br>
</div>
</span></font></div>
</body>
</html>