User Tools

Site Tools


gpu_isac

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
gpu_isac [2020/05/29 18:08]
fschoenfeld
gpu_isac [2020/06/18 11:11]
fschoenfeld
Line 40: Line 40:
   - **Untar the archive** using ''tar -xf GPU_ISAC_CHIMERA.tar''.   - **Untar the archive** using ''tar -xf GPU_ISAC_CHIMERA.tar''.
   - **Check CUDA path variables** using:   - **Check CUDA path variables** using:
-    - ''echo $PATH'' Does it contain the path to your **cuda/bin** folder?+    - <code>echo $PATH</code> Does it contain the path to your **cuda/bin** folder?
     - ''echo $LD_LIBRARY_PATH'' Does it contain the path to your **cuda/lib64** folder?     - ''echo $LD_LIBRARY_PATH'' Does it contain the path to your **cuda/lib64** folder?
     - If the path variables do **not** contain these path variables, you can add them like so:     - If the path variables do **not** contain these path variables, you can add them like so:
Line 51: Line 51:
   - **Adjust sparx libraries** to work with the C++/CUDA library we just compiled:   - **Adjust sparx libraries** to work with the C++/CUDA library we just compiled:
     - ''cd ../eman2/sparx/libpy''     - ''cd ../eman2/sparx/libpy''
-    - ''sed -i.bkp "s|/home/schoenf/work/code/cuISAC/cuda|$(realpath ../../../cuda)|g" applications.py'' +    - ''sed -i.bkp <nowiki>"</nowiki>s|/home/schoenf/work/code/cuISAC/cuda|$(realpath ../../../cuda)|g<nowiki>"</nowiki> applications.py'' 
-    - ''sed -i.bkp2 's|statistics.sum_oe( data, "a", CTF, EMData(), myid=myid|statistics.sum_oe( data, "a", CTF, EMData()|g' applications.py ''+    - ''sed -i.bkp2 's|statistics.sum_oe( data, <nowiki>"</nowiki>a<nowiki>"</nowiki>, CTF, EMData(), myid=myid|statistics.sum_oe( data, <nowiki>"</nowiki>a<nowiki>"</nowiki>, CTF, EMData()|g' applications.py ''
   - **Set the correct libraries and environment:**   - **Set the correct libraries and environment:**
     - ''cd ../bin'' (we are now in the **/eman2/sparx/bin** folder of your GPU ISAC installation folder)     - ''cd ../bin'' (we are now in the **/eman2/sparx/bin** folder of your GPU ISAC installation folder)
     - ''ln -rs ../libpy/* .'' (don't forget the dot at the end)     - ''ln -rs ../libpy/* .'' (don't forget the dot at the end)
-    - ''sed -i.bkp "s|/home/schoenf/applications/sphire/v1.1/envs/sphire_1.3/bin|$(dirname $(which sphire))|g" sxisac2_gpu.py'' +    - ''sed -i.bkp <nowiki>"</nowiki>s|/home/schoenf/applications/sphire/v1.1/envs/sphire_1.3/bin|$(dirname $(which sphire))|g<nowiki>"</nowiki> sxisac2_gpu.py'' 
-    - ''sed -i.bkp2 "s/^\(.*options, args.*\)$/\1\n    os.environ['CUDA_VISIBLE_DEVICES'] = options.gpu_devices\n options.gpu_devices = ','.join(map(str, range(len(options.gpu_devices.split(',')))))/g" sxisac2_gpu.py''+    - ''sed -i.bkp2 <nowiki>"</nowiki>s/^\(.*options, args.*\)$/\1\n    os.environ['CUDA_VISIBLE_DEVICES'] = options.gpu_devices\n options.gpu_devices = ','.join(map(str, range(len(options.gpu_devices.split(',')))))/g<nowiki>"</nowiki> sxisac2_gpu.py'' 
  
 ===== Usage ===== ===== Usage =====
Line 63: Line 64:
 An example call to use GPU ISAC looks as follows: An example call to use GPU ISAC looks as follows:
  
-**''mpirun''**''-np 6''**''/path/to/sxisac2_gpu.py''**''bdb:path/to/stack out_dir --CTF –radius=160  +<code> 
---target_radius=29 --target_nx=76 --img_per_grp=100 --minimum_grp_size=60 -thld_err=0.7+mpirun -np 6 /path/to/sxisac2_gpu.py bdb:path/to/stack out_dir --CTF -–radius=160 --target_radius=29 --target_nx=76 --img_per_grp=100 --minimum_grp_size=60 --thld_err=0.7 --center_method=0 --gpu_devices=0,
 +</code> 
 + 
 +More readable: 
 + 
 +<code> 
 +mpirun -np 6 /path/to/sxisac2_gpu.py 
 +bdb:path/to/stack out_dir 
 +--CTF  
 +-–radius=160 
 +--target_radius=29 
 +--target_nx=76 
 +--img_per_grp=100 
 +--minimum_grp_size=60 
 +--thld_err=0.7
 --center_method=0 --center_method=0
---gpu_devices=0,1'' +--gpu_devices=0,
-''--''+</code> 
 **[ ! ] - Mandatory** parameters in the GPU ISAC call: **[ ! ] - Mandatory** parameters in the GPU ISAC call:
  
Line 73: Line 89:
   * Replace ''path/to/stack'' with the path to your **input .bdb stack**. If you are using an **.hdf** stack, you need to remove the ''bdb:'' prefix.   * Replace ''path/to/stack'' with the path to your **input .bdb stack**. If you are using an **.hdf** stack, you need to remove the ''bdb:'' prefix.
   * Replace ''out_dir'' with the path to your preferred **output directory**.   * Replace ''out_dir'' with the path to your preferred **output directory**.
-  * Adjust the number in ''--radius=160'' to the **radius of your particle** (in pixels).+  * Adjust the number in ''<nowiki>--</nowiki>radius=160'' to the **radius of your particle** (in pixels).
  
 **[?] - Optional** parameters in the GPU ISAC call: **[?] - Optional** parameters in the GPU ISAC call:
  
   * In ''mpirun –np 6'' the number can be set to the number of your **CPU processors** (e.g., if you have a quad core CPU, you would use 4 here).    * In ''mpirun –np 6'' the number can be set to the number of your **CPU processors** (e.g., if you have a quad core CPU, you would use 4 here). 
-  * In ''--gpu_devices=0,1'' you can set **what GPUs to use**. This example uses two GPUs with id values 0 and 1, respectively. You can check the id values of your available GPUs by executing ''nvidia-smi'' in your terminal (GPUs are sorted by capability, with 0 being your strongest GPU). +  * Using ''<nowiki>--</nowiki>gpu_devices'' you can set **what GPUs to use**. This example uses two GPUs with id values 0 and 1, respectively. You can check the id values of your available GPUs by executing ''nvidia-smi'' in your terminal (GPUs are sorted by capability, with 0 being your strongest GPU). 
-  * You can also use ''--img_per_grp'' to limit the **maximum size of individual classes**. Empirically, a class size of 100-200 (30-50 for negative stain) particles has been proven successful when dealing with around 100,000 particles. +  * You can also use ''<nowiki>--</nowiki>img_per_grp'' to limit the **maximum size of individual classes**. Empirically, a class size of 100-200 (30-50 for negative stain) particles has been proven successful when dealing with around 100,000 particles. 
-  * Similarly, you can also use ''--minimum_grp_size'' to limit the **minimum size of individual classes**. In general, this value should be around 50-60% of your maximum class size.+  * Similarly, you can also use ''<nowiki>--</nowiki>minimum_grp_size'' to limit the **minimum size of individual classes**. In general, this value should be around 50-60% of your maximum class size.
  
 <note> <note>
gpu_isac.txt · Last modified: 2021/05/08 00:41 by shaikh