Page 1 of 1

Error running demo_notebook

Posted: Tue Oct 15, 2019 8:06 am
by jandrey
Hi,

I got the following error when running "demo_notebook". What I am doing wrong ?

--------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-bb6d99bb8a50> in <module>
5 import os, sys
6 sys.path.insert(0, os.path.dirname(os.getcwd()))
----> 7 from smartg.smartg import Smartg, Sensor
8 from smartg.smartg import RoughSurface, LambSurface, FlatSurface, Environment, Albedo_cst
9 from smartg.atmosphere import AtmAFGL, AeroOPAC, CloudOPAC, diff1, read_phase

/nfs/sdb1/RTMs/smartg-v0.9.2/smartg/smartg.py in <module>
23 import subprocess
24 from collections import OrderedDict
---> 25 from pycuda.gpuarray import to_gpu, zeros as gpuzeros
26 import pycuda.driver as cuda
27 from smartg.bandset import BandSet

/nfs/sdb1/Soft/anaconda3/envs/smartg/lib/python3.6/site-packages/pycuda-2017.1-py3.6-linux-x86_64.egg/pycuda/gpuarray.py in <module>
2
3 import numpy as np
----> 4 import pycuda.elementwise as elementwise
5 from pytools import memoize, memoize_method
6 import pycuda.driver as drv

/nfs/sdb1/Soft/anaconda3/envs/smartg/lib/python3.6/site-packages/pycuda-2017.1-py3.6-linux-x86_64.egg/pycuda/elementwise.py in <module>
33
34
---> 35 from pycuda.tools import context_dependent_memoize
36 import numpy as np
37 from pycuda.tools import dtype_to_ctype, VectorArg, ScalarArg

/nfs/sdb1/Soft/anaconda3/envs/smartg/lib/python3.6/site-packages/pycuda-2017.1-py3.6-linux-x86_64.egg/pycuda/tools.py in <module>
32 """
33
---> 34 import pycuda.driver as cuda
35 from decorator import decorator
36 import pycuda._driver as _drv

/nfs/sdb1/Soft/anaconda3/envs/smartg/lib/python3.6/site-packages/pycuda-2017.1-py3.6-linux-x86_64.egg/pycuda/driver.py in <module>
3 import six
4 try:
----> 5 from pycuda._driver import * # noqa
6 except ImportError as e:
7 if "_v2" in str(e):

ImportError: libcurand.so.8.0: cannot open shared object file: No such file or directory

Re: Error running demo_notebook

Posted: Tue Oct 15, 2019 8:27 am
by LaurentWandrebeck
Hello jandrey,

It looks like pycuda (which is a quite old version) depends on an old version of cuda (8).

Simpler (but a bit ugly) way that should work: find where libcurand.so* is located (find / -name 'libcurand.so*' in linux). Go to that directory, and make a symbolic link (ln -s libcurand.so.?.0 libcurand.so.8.0). Replace ? with the version that was found on the system.
Other possibilities are: install cuda8 or install a newer version of pycuda (2019.1 should do the trick).

HTH,

Re: Error running demo_notebook

Posted: Mon Oct 21, 2019 9:20 am
by jandrey
Hi Again,

Thank you for your previous comment. I have installed pycuda 2019.1 using pip. I am using anaconda with a dedicated environment to run 'smartg'.

I had to modify the PYTHONPATH as follows to allow python to recognize smartg as a package, and the pycuda version I installed with pip :

export PYTHONPATH=/nfs/sdb1/Soft/anaconda3/lib/python3.7/site-packages:/nfs/sdb1/RTMs/smartg-v0.9.2

When I run the followiing line i got this error:


-----------------------
(smartg) javier@server:/nfs/sdb1/RTMs/smartg-v0.9.2$ python3 tests/test_smartg.py

================================
Traceback (most recent call last):
File "tests/test_smartg.py", line 10, in <module>
from smartg.smartg import Smartg, RoughSurface, LambSurface
File "/nfs/sdb1/RTMs/smartg-v0.9.2/smartg/smartg.py", line 12, in <module>
import numpy as np
File "/nfs/sdb1/Soft/anaconda3/lib/python3.7/site-packages/numpy/__init__.py", line 140, in <module>
from . import _distributor_init
File "/nfs/sdb1/Soft/anaconda3/lib/python3.7/site-packages/numpy/_distributor_init.py", line 34, in <module>
from . import _mklinit
ImportError: cannot import name '_mklinit'
================================

Apparently, if I am not wrong, the code need a numpy version adpated to the intel mkl library. IS that right ? How I do procced to run the code ?




For information, my computer has the following characteristics:

Intel(R) Core(TM) i7-7820X CPU @ 3.60GHz
8 processors with HT,
128 GB RAM
Nvidia Quadro P2000

Running Ubuntu server 18.04.3 LTS

Thanks in advance,
Javier

Re: Error running demo_notebook

Posted: Mon Oct 21, 2019 9:26 am
by LaurentWandrebeck
Hey,

Looks like you have installed a MKL (Intel Math Kernel Library) enabled version of numpy. Either you can disable MKL optimizations, or install MKL.

Please see https://docs.anaconda.com/mkl-optimizations/ for further informations.

HTH,