Scripting local refinement volume alignment: pycuda question


I’m currently trying to create a script for use that uses several parts of cryosparc_compute to align particle stacks based on the alignment of their corresponding local refinement volumes (i.e., update their poses/shifts). I have this working for user input rotation/translation matrices using cryosparc_compute.newgeometry.transform_particle_alignments, but I would like to automate the calculation of these matrices using cryosparc_compute.align3D_gpu.align_volumes. However, I can’t do from cryosparc_compute import align3D_gpu because the interpreter (I’m using cryosparcm icli to run my script) can’t see pycuda… This is just a ModuleNotFoundError but I pasted the output below just in case. Is there some extra trick/import that I’m missing to get this to work without messing up the env?


In [2]: from cryosparc_compute import align3D_gpu
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-9f312814dd8a> in <module>
----> 1 from cryosparc_compute import align3D_gpu

~/software/cryosparc/cryosparc_master/cryosparc_compute/ in <module>
     11 from . import geometry, fourier, sigproc
     12 import numpy as n
---> 13 from .cudaworker import cudaworker as cudaworker
     14 import pycuda.gpuarray as gpuarray
     15 from .engine import cuda_core

~/software/cryosparc/cryosparc_master/cryosparc_compute/cudaworker/ in <module>
      6 ## ---------------------------------------------------------------------------
----> 8 from .cudaworker import *  # noqa: F401,F403

~/software/cryosparc/cryosparc_master/cryosparc_compute/cudaworker/ in <module>
     14 import jinja2
---> 16 from pycuda.reduction import ReductionKernel
     17 import pycuda.driver as cudrv
     18 import pycuda.gpuarray as gpuarray

ModuleNotFoundError: No module named 'pycuda'

Relevant functionality has been added in yesterday’s patch.

1 Like