which topaz
/home/mjmcleod/eman2-sphire-sparx/envs/topaz/bin/topaz
Put this path into cryosparc and ran. It would run, but would not use GPU.
Attempt 2: Realized I had the wrong python version as well as cuda version
conda remove -n topaz --all
python3 --version
Python 3.9.16
conda create -n topaz python=3.9.16
conda activate topaz
conda install topaz=0.2.4 cudatoolkit=11.7 -c tbepler -c pytorch -c conda-forge
With error:
Receive this error: T**raceback (most recent call last):
File “cryosparc_master/cryosparc_compute/run.py”, line 96, in cryosparc_compute.run.main
File “/home/mjmcleod/cryosparc/cryosparc_worker/cryosparc_compute/jobs/topaz/run_topaz.py”, line 307, in run_topaz_wrapper_train
utils.run_process(split_command)
File “/home/mjmcleod/cryosparc/cryosparc_worker/cryosparc_compute/jobs/topaz/topaz_utils.py”, line 98, in run_process
assert process.returncode == 0, f"Subprocess exited with status {process.returncode} ({str_command})"
AssertionError: Subprocess exited with status 1 (/home/mjmcleod/eman2-sphire-sparx/envs/topaz/bin/topaz train_test_split --number 60 --seed 1593130959 --image-dir /media/mjmcleod/870qvo_2/eh12_10pep/CS-eh12-10mmpep/J190/preprocessed /media/mjmcleod/870qvo_2/eh12_10pep/CS-eh12-10mmpep/J190/topaz_particles…)
Looking at what is in the topaz conda environment:
conda list and this is the pytorch installed which looks like its the cpu only.
pytorch conda-forge/linux-64::pytorch-2.0.0-cpu_generic_py39h08b6d46_2
It looks like the first issue was the pytorch version wasnt compatible with CUDA. Now, after reinstalling with proper CUDA version, there is another issue which I am unsure how to proceed. Any insight would be appreciated. Matt
I am not sure whether or not it is necessary to have a GPU and nvidia driver installed on the computer where you run the conda install command.
The commands were copied from the github repository 2023-09-20, but may be outdated by the time you read this.
After topaz installation, specify a wrapper script as Path to Topaz executable and retry the topaz job.
I reinstalled but used:
conda install cudatoolkit=11.7 topaz -c tbepler -c pytorch
since without cudatoolkit the program environment wouldnt solve over 24 hours (I assume this is process should take less time). With cuda specified it was about 20 minutes.
I made the topaz.sh file and saved in home directory and,
chmod +x topaz.sh
the topaz.sh file contains
#!/usr/bin/env bash
if command -v conda > /dev/null 2>&1; then
conda deactivate > /dev/null 2>&1 || true # ignore any errors
conda deactivate > /dev/null 2>&1 || true # ignore any errors
fi
unset _CE_CONDA
unset CONDA_DEFAULT_ENV
unset CONDA_EXE
unset CONDA_PREFIX
unset CONDA_PROMPT_MODIFIER
unset CONDA_PYTHON_EXE
unset CONDA_SHLVL
unset PYTHONPATH
unset LD_PRELOAD
unset LD_LIBRARY_PATH
Try to rerun topaz through cryosparc and receive this error:
raceback (most recent call last):
File “cryosparc_master/cryosparc_compute/run.py”, line 96, in cryosparc_compute.run.main
File “/home/mjmcleod/cryosparc/cryosparc_worker/cryosparc_compute/jobs/topaz/run_topaz.py”, line 111, in run_topaz_wrapper_train
topaz_version = utils.get_topaz_version(topaz_exec_path)
File “/home/mjmcleod/cryosparc/cryosparc_worker/cryosparc_compute/jobs/topaz/topaz_utils.py”, line 135, in get_topaz_version
assert semver.VersionInfo.isvalid(topaz_version_for_validation),
AssertionError: Cannot determine topaz version, command “/home/mjmcleod/topaz.sh --version” did not produce valid output: “/home/mjmcleod/topaz.sh: line 19: exec: topaz: not found”
In terminal:
conda activate topaz
topaz --version
TOPAZ 0.2.5a
Do you have any suggestions? Not quite sure why its not reading topaz.
OK I switched the path in topaz.sh to eman2-sphire-sparx/etc/conda/profile.d/conda.sh and it is running. I can update if it is using GPU once it finishes preprocessing.