The outputs indicate that a CUDA toolkit-related directory still present in the “pre-CryoSPARC” LD_LIBRARY_PATH environment variable and may interfere with CryoSPARC installation and operation. See, for example, here for a general discussion of environment variables.
that /home/david/cryosparc/cryosparc_master/bin has been added to the PATH multiple times. You may be able to avoid multiple occurrences by ensuring there is no more than one occurrence of export PATH=/home/david/cryosparc/cryosparc_master/bin:$PATH
in ~/.bashrc.
the presence of /usr/local/cuda/bin in your “pre-CryoSPARC” PATH, which may interfere with CryoSPARC installation and operation.
The error looks very similar to mine (when try to run 2D classification).
My current error when running 2D classification →
[CPU: 195.1 MB Avail: 11.76 GB]
Traceback (most recent call last):
File “cryosparc_master/cryosparc_compute/run.py”, line 83, in cryosparc_compute.run.main
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/jobs/jobregister.py”, line 442, in get_run_function
runmod = importlib.import_module(“…”+modname, name)
File “/home/david/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 1174, in exec_module
File “”, line 219, in _call_with_frames_removed
File “cryosparc_master/cryosparc_compute/jobs/class2D/run.py”, line 13, in init cryosparc_compute.jobs.class2D.run
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/engine/init.py”, line 8, in
from .engine import * # noqa
File “cryosparc_master/cryosparc_compute/engine/engine.py”, line 9, in init cryosparc_compute.engine.engine
File “cryosparc_master/cryosparc_compute/engine/cuda_core.py”, line 4, in init cryosparc_compute.engine.cuda_core
ModuleNotFoundError: No module named ‘pycuda’
What do you think?
Could you please explain the solution? “cryosparcw forcedeps` fixes this issue.”
The command /path/to/cryosparc_worker/cryosparcw forcedeps
configures CryoSPARC dependencies.
I have not tested whether this command will result in a functional worker installation under WSL2.
@wtempel - interesting.
it seems that I don’t have it.
david@DESKTOP-D1IHD96:~/cryosparc/cryosparc_worker$ cryosparcw forcedeps
cryosparcw: command not found
david@DESKTOP-D1IHD96:~/cryosparc/cryosparc_worker$ ./cryosparcw forcedeps
-bash: ./cryosparcw: No such file or directory
all I have inside the cryosparc_worker folder similar are
The error remains but got modified (for 2D classification)
error before - cryosparcw forcedeps
Traceback (most recent call last):
File “cryosparc_master/cryosparc_compute/run.py”, line 83, in cryosparc_compute.run.main
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/jobs/jobregister.py”, line 442, in get_run_function
runmod = importlib.import_module(“…”+modname, name)
File “/home/david/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 1174, in exec_module
File “”, line 219, in _call_with_frames_removed
File “cryosparc_master/cryosparc_compute/jobs/class2D/run.py”, line 13, in init cryosparc_compute.jobs.class2D.run
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/engine/init.py”, line 8, in
from .engine import * # noqa
File “cryosparc_master/cryosparc_compute/engine/engine.py”, line 9, in init cryosparc_compute.engine.engine
File “cryosparc_master/cryosparc_compute/engine/cuda_core.py”, line 4, in init cryosparc_compute.engine.cuda_core
ModuleNotFoundError: No module named ‘pycuda’
==================================================================
error after using - cryosparcw forcedeps
Traceback (most recent call last):
File “cryosparc_master/cryosparc_compute/run.py”, line 83, in cryosparc_compute.run.main
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/jobs/jobregister.py”, line 442, in get_run_function
runmod = importlib.import_module(“…”+modname, name)
File “/home/david/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 1174, in exec_module
File “”, line 219, in _call_with_frames_removed
File “cryosparc_master/cryosparc_compute/jobs/class2D/run.py”, line 13, in init cryosparc_compute.jobs.class2D.run
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/engine/init.py”, line 8, in
from .engine import * # noqa
File “cryosparc_master/cryosparc_compute/engine/engine.py”, line 9, in init cryosparc_compute.engine.engine
File “cryosparc_master/cryosparc_compute/engine/cuda_core.py”, line 12, in init cryosparc_compute.engine.cuda_core
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/skcuda_internal/fft.py”, line 27, in
from . import misc2 as misc
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/skcuda_internal/misc2.py”, line 32, in
from . import cuda
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/skcuda_internal/cuda.py”, line 17, in
from .cudadrv import *
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/skcuda_internal/cudadrv.py”, line 39, in
raise OSError(‘CUDA driver library not found’)
OSError: CUDA driver library not found
This seemed to be a problem with the CUDA driver and not with the toolkit. The problem is that cudadrv.py tries to locate the runtime library libcuda.so file and this is not found because WSL/WSL2 has a different location for it.
The solution was to append “/usr/lib/wsl/lib” to LD_LIBRARY_PATH (either in .bashrc or prior to execution should work). After that, the cuda driver management inside cryosparc can detect the library and everything works just fine both inside Scipion and in standalone.
The long term solution could be for cryosparc to detect it’s running inside of WSL2 and adding /usr/lib/wsl/lib to the path automatically, I guess.
I got a new error running 3D Homogenoius Refinement.
=================================================
Traceback (most recent call last):
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/jobs/runcommon.py”, line 2061, in run_with_except_hook
run_old(*args, **kw)
File “cryosparc_master/cryosparc_compute/engine/cuda_core.py”, line 131, in cryosparc_compute.engine.cuda_core.GPUThread.run
File “cryosparc_master/cryosparc_compute/engine/cuda_core.py”, line 132, in cryosparc_compute.engine.cuda_core.GPUThread.run
File “cryosparc_master/cryosparc_compute/engine/engine.py”, line 1084, in cryosparc_compute.engine.engine.process.work
File “cryosparc_master/cryosparc_compute/engine/engine.py”, line 346, in cryosparc_compute.engine.engine.EngineThread.compute_error
File “cryosparc_master/cryosparc_compute/engine/cuda_core.py”, line 337, in cryosparc_compute.engine.cuda_core.EngineBaseThread.ensure_allocated
pycuda._driver.MemoryError: cuMemHostAlloc failed: out of memory
By default, WSL2 assigns a stupidly small amount of system memory. Well, it’s OK if you just want to “play” in a Linux VM but is far too little for anything serious. The Microsoft documentation shows that on recent builds, it will assign whichever is the smaller of 50% of system RAM or 8GB. So on a box with 64GB of RAM, my WSL2 VMs are assigned 8GB by default, which is nowhere near enough for CryoSPARC.
I would recommend following the instructions on this Microsoft page, although I would recommend assigning at least 40GB, probably more like 48GB to any WSL2 VM you want to run CryoSPARC in.
Thank you for your explanations and suggestions! yes, indeed - originally WSL2 has setting up only 8GB of memory by default. So I manage to increase the usage visible by WSL2 to 14GB.
I have upgraded the RAM to 64GB and allocated about 54GB for WSL2.
But the error I had before with not enough memory is still there.
Traceback (most recent call last):
File “/home/david/cryosparc/cryosparc_worker/cryosparc_compute/jobs/runcommon.py”, line 2061, in run_with_except_hook
run_old(*args, **kw)
File “cryosparc_master/cryosparc_compute/engine/cuda_core.py”, line 131, in cryosparc_compute.engine.cuda_core.GPUThread.run
File “cryosparc_master/cryosparc_compute/engine/cuda_core.py”, line 132, in cryosparc_compute.engine.cuda_core.GPUThread.run
File “cryosparc_master/cryosparc_compute/engine/engine.py”, line 1084, in cryosparc_compute.engine.engine.process.work
File “cryosparc_master/cryosparc_compute/engine/engine.py”, line 346, in cryosparc_compute.engine.engine.EngineThread.compute_error
File “cryosparc_master/cryosparc_compute/engine/cuda_core.py”, line 337, in cryosparc_compute.engine.cuda_core.EngineBaseThread.ensure_allocated
pycuda._driver.MemoryError: cuMemHostAlloc failed: out of memory
Can it be that CS does not see the RAM upgrade?
How to set it then?