Failed to import dadi.cuda

162 views
Skip to first unread message

Farhad Farhadi

unread,
Feb 17, 2021, 4:43:28 AM2/17/21
to dadi-user
Dear Rayan and dadi users


I am trying to use pycuda but I get this error Failed to import dadi.cuda
I have both pycuda and scikit-cuda installed (Ubuntu OS- on dell PC with 16Gb ram) and  my dadi  is the latest version. Any comment please?

Samuel Wittwer

unread,
Feb 17, 2021, 8:01:28 AM2/17/21
to dadi-user
Hello

Sorry to jump in but you also need to install the nvidia CUDA toolkit: https://developer.nvidia.com/cuda-downloads

I got lucky and I can use virtual machines with CUDA preinstalled for my more time consuming analyses... haven't yet managed to get this running on my personal Ubuntu machine, however.

Cheers
Sam

Ryan Gutenkunst

unread,
Feb 17, 2021, 12:01:44 PM2/17/21
to dadi-user
Hello Farhad and Sam,

Thanks for jumping in Sam! If either of you still has problems, we can debug a bit by deconstructing what happens behind the scenes when you import dadi.cuda. Just let me know if you want to dig in .

Best,
Ryan
> --
> You received this message because you are subscribed to the Google Groups "dadi-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dadi-user+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dadi-user/2bbf8dfb-b2b1-4845-b736-cef81d48294cn%40googlegroups.com.

Farhad Farhadi

unread,
Feb 17, 2021, 2:44:11 PM2/17/21
to dadi-user
Hi Ryan and Sam

It seems I need to install CUDA toolkit, but seems it needs more than 2Gb space. I prefer not to install it if there would be other way.

Many thanks
Farhad

Ryan Gutenkunst

unread,
Feb 17, 2021, 4:38:16 PM2/17/21
to dadi-user
Hello Farhad,

I believe you can install only a subset of the toolkit. See https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html#installing-cuda-development-tools . I’m not exactly sure which subpackages are essential, but I bet you could get away with:
nvcc
cublas
cusparse

Best,
Ryan
> To view this discussion on the web visit https://groups.google.com/d/msgid/dadi-user/c8d24e7e-262b-4562-a463-4bf72aba1a28n%40googlegroups.com.

Farhad Farhadi

unread,
Feb 17, 2021, 7:19:16 PM2/17/21
to dadi-user
its a bit strange
I am trying to run on models on cluster with pycuda and scikit-cuda installed
AttributeError: module 'dadi' has no attribute 'cuda_enabled'

Ryan Gutenkunst

unread,
Feb 18, 2021, 2:19:11 PM2/18/21
to dadi...@googlegroups.com
Hello Farhad,

That suggest you have an older version of dadi installed, prior to the addition of CUDA support.

Best,
Ryan
> To view this discussion on the web visit https://groups.google.com/d/msgid/dadi-user/29d23ce5-bdff-4adf-8aa8-29557fbcea25n%40googlegroups.com.

Farhad Farhadi

unread,
Feb 20, 2021, 8:52:17 PM2/20/21
to dadi-user
Hi all

Following up the dadi.cuda issue, using gpu and  pycuda is only possible in nivida graphic device not Intel HD graphics? am I right?

Many thanks 
Farhad

Ryan Gutenkunst

unread,
Feb 22, 2021, 11:57:14 AM2/22/21
to dadi-user
This is correct, you need an Nvidia card. (For now at least: https://www.tomshardware.com/news/zluda-project-cuda-intel-gpus )

Best,
Ryan
> To view this discussion on the web visit https://groups.google.com/d/msgid/dadi-user/93e3cc65-2b28-4c8d-8a34-7cc182bac0d7n%40googlegroups.com.

Farhad Farhadi

unread,
Feb 22, 2021, 3:52:07 PM2/22/21
to dadi-user
Ryan

Thank yo so much for all helps. 
I am wondering if there is any other way to increase the computation speed specially when using cluster.
I am trying to run my models on HPC cluster but it uses only one cpu and taking a lot of time. I imagine I can't parallelize job using dadi right? Also to use GPU on cluster, any specific version of cuda is required or any any limitation on cuda?

Many thanks again.
Farhad

Ryan Gutenkunst

unread,
Feb 22, 2021, 6:44:23 PM2/22/21
to dadi-user
Hello Farhad,

The expensive part of almost all dadi analyses is optimization, and you typically need to run multiple optimization runs to ensure convergence. So the easy way to parallelize is to run multiple optimization runs independently, then compare results.

We’re in the process of developing a framework for making this easier, including using cloud computing resources. But if you’re cluster-savvy, it’s not too hard to roll your own.

The key CUDA function dadi relies on is gtsv2StridedBatch. I’m not sure which version of the toolkit that was add in. I know it works in version 10, but I’m not how far back it goes.

Best,
Ryan
> To view this discussion on the web visit https://groups.google.com/d/msgid/dadi-user/93fef7e1-a21a-4a11-a970-78ecee431786n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages