Installing dedalus and pytorch together

55 views
Skip to first unread message

Jaideep Pathak

unread,
Apr 16, 2020, 8:44:47 PM4/16/20
to Dedalus Users
Hi,

I'm trying to work with dedalus and I need it to be installed in an environment with pytorch. I tried the simplest thing which was to install dedalus first and then conda install pytorch in the same environment. The installation went through without any errors but I get a runtime error:

2020-04-16 17:37:36,583 pencil 0/1 INFO :: Building pencil matrix 256/256 (~100%) Elapsed: 8s, Remaining: 0s, Rate: 3.1e+01/s
2020-04-16 17:37:36,615 __main__ 0/1 INFO :: Solver built
(1.0, 1.0)
Traceback (most recent call last):
  File "rbc2d.py", line 86, in <module>
    b.differentiate('z', out=bz)
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/core/field.py", line 462, in differentiate
    diff = diff.evaluate()
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/core/future.py", line 130, in evaluate
    a.set_scales(self.domain.dealias, keep_data=True)
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/core/field.py", line 382, in set_scales
    self.require_coeff_space(axis)
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/core/field.py", line 443, in require_coeff_space
    self.towards_coeff_space()
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/core/field.py", line 423, in towards_coeff_space
    self.domain.dist.paths[index-1].decrement([self])
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/core/distributor.py", line 366, in decrement
    self.decrement_single(*fields)
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/core/distributor.py", line 351, in decrement_single
    self.basis.forward(gdata, cdata, self.axis, field.meta[self.axis], field.scales[self.axis])
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/core/basis.py", line 1472, in _forward_fftw
    plan, temp, resize_coeffs = self._fftw_setup(gdata.dtype, gdata.shape, axis)
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/tools/cache.py", line 71, in __call__
    self.cache[call] = result = self.function(*args, **kw)
  File "/home/jpathak/anaconda3/envs/dedalus/lib/python3.7/site-packages/dedalus/core/basis.py", line 1459, in _fftw_setup
    plan = fftw.FourierTransform(dtype, gshape, axis, flags=flags)
  File "dedalus/libraries/fftw/fftw_wrappers.pyx", line 194, in dedalus.libraries.fftw.fftw_wrappers.FourierTransform.__init__
RuntimeError: FFTW could not create plans.

I see that the "RuntimeError: FFTW could not create plans." has been documented on this group before but I couldn't find a solution. Perhaps someone here has tried to do something similar and can point me in the right direction. Thanks!

Best,
Jaideep

Jaideep Pathak

unread,
Apr 21, 2020, 8:05:49 PM4/21/20
to Dedalus Users
Hi all,

I'm going to provide a quick update to this as the solution was simple.

Install dedalus with the conda script in the official dedalus documentation.

Then install pytorch using:

conda install pytorch torchvision -c pytorch


For some reason that I don't understand, conda install pytorch torchvision without specifying the channel with -c pytorch causes the "RuntimeError: FFTW could not create plans." error. This is pretty strange to me and maybe someone to someone with more experience this is trivial. In any case, I'm posting this so someone else does not have to spend time figuring out manual installation from source of both packages.

Best,
Jaideep

Keaton Burns

unread,
Apr 21, 2020, 9:55:05 PM4/21/20
to dedalu...@googlegroups.com
Hi Jaideep,

Thanks for the update.  My guess is that the previous installation also pulled in MKL, which breaks many programs (including Dedalus) that rely on FFTW.  It may have worked if you subsequently rebuilt Dedalus with the FFTW_STATIC environment variable enabled, but I’m not sure.

Best,
-Keaton
--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/1897ffd7-e86b-46cf-b31c-536a41cba236%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages