Uni-Dock icon indicating copy to clipboard operation
Uni-Dock copied to clipboard

CUDA Runtime Error when running Uni-Dock

Open hotwa opened this issue 2 years ago • 11 comments

Hello,

I'm encountering a CUDA Runtime Error when trying to run Uni-Dock on my system. The error message is as follows:

Performing docking (random seed: 1521015319) ... CUDA error at /root/code/Uni-Dock-private/src/cuda/monte_carlo.cu:1719 code=2(cudaErrorMemoryAllocation) "cudaMallocHost(&p_data, sizeof(p_m_data_cuda_t) * MAX_P_DATA_M_DATA_SIZE)"

This error occurs when I run the following command:

./unidock --receptor 7s68_fixed_pH_7.pdbqt --gpu_batch ./ex.pdbqt --search_mode balance --scoring vina --center_x 2.0 --center_y 30.0 --center_z 64.0 --size_x 18.0 --size_y 16.0 --size_z 16.0 --num_modes 20 --dir ./docked

My system is running Windows 10 with WSL2 of Ubuntu 20.04. I have installed the CUDA toolkit (WSL version). When running Uni-Dock, it seems that the GPU is not being utilized, but the CPU is working at 100% load.

Here is the output of nvidia-smi on my system:

Sun Jul 16 20:40:02 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.54.04              Driver Version: 536.23       CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 4090        On  | 00000000:01:00.0  On |                  Off |
|  0%   41C    P8              30W / 450W |   2769MiB / 24564MiB |     11%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

Any help in resolving this issue would be greatly appreciated. Thank you!

hotwa avatar Jul 16 '23 12:07 hotwa

Add: root@DESKTOP-1IV2ND2:~/screening# nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Fri_Jan__6_16:45:21_PST_2023 Cuda compilation tools, release 12.0, V12.0.140 Build cuda_12.0.r12.0/compiler.32267302_0

hotwa avatar Jul 16 '23 12:07 hotwa

Hi @hotwa , Looks like you and @XingyuLiao in #12 are facing the same problem. We are trying to build a WSL environment and further investigate this issue.

caic99 avatar Jul 16 '23 13:07 caic99

execute in docker images: I use this images: nvidia/cuda:latest. root@fa5ddca634eb:/# ./unidock --receptor ./input_file_example/2bm2_protein.pdbqt --gpu_batch ./input_file_example/2bm2_ ligand.pdbqt --search_mode balance --scoring vina --center_x 40.415 --center_y 110.986 --center_z 82.673 --size_x 25 --size_y 25 --size_z 25 --num_modes 20 --dir ./input_file_example/ Uni-Dock v0.1.0

If you used Uni-Dock in your work, please cite:

Yu, Y., Cai, C., Wang, J., Bo, Z., Zhu, Z., & Zheng, H. (2023). Uni-Dock: GPU-Accelerated Docking Enables Ultralarge Virtual Screening. Journal of Chemical Theory and Computation. https://doi.org/10.1021/acs.jctc.2c01145

Tang, S., Chen, R., Lin, M., Lin, Q., Zhu, Y., Ding, J., ... & Wu, J. (2022). Accelerating autodock vina with gpus. Molecules, 27(9), 3041. DOI 10.3390/molecules27093041

J. Eberhardt, D. Santos-Martins, A. F. Tillack, and S. Forli AutoDock Vina 1.2.0: New Docking Methods, Expanded Force Field, and Python Bindings, J. Chem. Inf. Model. (2021) DOI 10.1021/acs.jcim.1c00203

O. Trott, A. J. Olson, AutoDock Vina: improving the speed and accuracy of docking with a new scoring function, efficient optimization and multithreading, J. Comp. Chem. (2010) DOI 10.1002/jcc.21334

Please refer to https://github.com/dptech-corp/Uni-Dock/ for bug reporting, license agreements, and more information.

Scoring function : vina Rigid receptor: ./input_file_example/2bm2_protein.pdbqt Grid center: X 40.415 Y 110.986 Z 82.673 Grid size : X 25 Y 25 Z 25 Grid space : 0.375 Exhaustiveness: 384 CPU: 0 Verbosity: 1

Computing Vina grid ... entering done done. exiting done Total ligands: 1 Avaliable Memory = 23006MiB Total Memory = 24563MiB Batch 1 size: 1 Performing docking (random seed: -1212963753) ... CUDA error at /root/code/Uni-Dock-private/src/cuda/monte_carlo.cu:1719 code=2(cudaErrorMemoryAllocation) "cudaMallocHost(&p_data, sizeof(p_m_data_cuda_t) * MAX_P_DATA_M_DATA_SIZE)"

An error occurred: CUDA Runtime Error.

Please report bugs through the Issue Tracker on GitHub (https://github.com/dptech-corp/Uni-Dock/issues)., so that this problem can be resolved. The reproducibility of the error may be vital, so please remember to include the following in your problem report:

  • the EXACT error message,
  • your version of the program,
  • the type of computer system you are running it on,
  • all command line options,
  • configuration file (if used),
  • ligand file as PDBQT,
  • receptor file as PDBQT,
  • flexible side chains file as PDBQT (if used),
  • output file as PDBQT (if any),
  • input (if possible),
  • random seed the program used (this is printed when the program starts).

Thank you!

hotwa avatar Jul 17 '23 02:07 hotwa

I encountered an issue while using Uni-Dock for molecular docking. When I ran the command ./unidock --receptor ./input_file_example/2bm2_protein.pdbqt --gpu_batch ./input_file_example/2bm2_ligand.pdbqt --search_mode balance --scoring vina --center_x 40.415 --center_y 110.986 --center_z 82.673 --size_x 25 --size_y 25 --size_z 25 --num_modes 20 --dir ./input_file_example, the output showed "Total ligands: 1," but then I received an error message saying "ERROR: Empty ligand list."

Here is my environment information:

Operating System: Ubuntu 20.04 GPU: NVIDIA Titan V Driver Version: 530.30.02 CUDA Version: 12.1 I have confirmed that the ligand file exists and the correct path is specified. I have tried other command and parameter combinations in the same environment, but I still encounter the same issue.

I would like to understand why this error occurs and find a solution. Any help or insights would be greatly appreciated. Thank you!

./unidock --receptor ./input_file_example/2bm2_protein.pdbqt --gpu_batch ./input_file_example/2bm2_ligand.pdbqt --search_mode balance --scoring vina --center_x 40.415 --center_y 110.986 --center_z 82.673 --size_x 25 --size_y 25 --size_z 25 --num_modes 20 --dir ./input_file_example
Uni-Dock v0.1.0

If you used Uni-Dock in your work, please cite:               
 
Yu, Y., Cai, C., Wang, J., Bo, Z., Zhu, Z., & Zheng, H. (2023). 
Uni-Dock: GPU-Accelerated Docking Enables Ultralarge Virtual Screening. 
Journal of Chemical Theory and Computation.                    
https://doi.org/10.1021/acs.jctc.2c01145                       

Tang, S., Chen, R., Lin, M., Lin, Q., Zhu, Y., Ding, J., ... & Wu, J. (2022). 
Accelerating autodock vina with gpus. Molecules, 27(9), 3041. 
DOI 10.3390/molecules27093041                                 

J. Eberhardt, D. Santos-Martins, A. F. Tillack, and S. Forli  
AutoDock Vina 1.2.0: New Docking Methods, Expanded Force      
Field, and Python Bindings, J. Chem. Inf. Model. (2021)       
DOI 10.1021/acs.jcim.1c00203                                  

O. Trott, A. J. Olson,                                        
AutoDock Vina: improving the speed and accuracy of docking    
with a new scoring function, efficient optimization and        
multithreading, J. Comp. Chem. (2010)                         
DOI 10.1002/jcc.21334                                         

Please refer to https://github.com/dptech-corp/Uni-Dock/ for  
bug reporting, license agreements, and more information.      

Scoring function : vina
Rigid receptor: ./input_file_example/2bm2_protein.pdbqt
Grid center: X 40.415 Y 110.986 Z 82.673
Grid size  : X 25 Y 25 Z 25
Grid space : 0.375
Exhaustiveness: 384
CPU: 0
Verbosity: 1

Computing Vina grid ... entering done
done.
exiting done
Total ligands: 1
Avaliable Memory = 4450MiB   Total Memory = 12054MiB
Batch 1 size: 0
ERROR: Empty ligand list.

hotwa avatar Jul 17 '23 02:07 hotwa

Hi @hotwa , Sorry for the late reply. It seems that your GPU memory size is insufficient for Uni-Dock to launch. We are working on the compatibility on multiple GPUs.

caic99 avatar Aug 24 '23 05:08 caic99

I need at least 24GB of GPU memory for Uni-Dock to launch?

hotwa avatar Aug 24 '23 05:08 hotwa

I need at least 24GB of GPU memory for Uni-Dock to launch?

@hotwa 12GB is recommended. Please see https://github.com/dptech-corp/Uni-Dock/issues/9#issuecomment-1616488315

caic99 avatar Aug 25 '23 01:08 caic99

Hi @hotwa ,

I compiled Uni-Dock from source code and successfully finished the task under examples/screening_test. I use ubuntu 22.04 with WSL2, on my 3070 Ti 8GB GPU. It seems that Uni-Dock works smoothly on WSL2 systems.

You could compiling from source code and try again.

caic99 avatar Sep 25 '23 05:09 caic99

I use binary file,before. Maybe is the compiled problem.

hotwa avatar Sep 25 '23 05:09 hotwa

When compiled it, I have some trouble. if unidock runing in anaconda, will be great.

hotwa avatar Sep 25 '23 06:09 hotwa

When compiled it, I have some trouble. if unidock runing in anaconda, will be great.

Please try: conda install -c https://conda.mlops.dp.tech/caic -c conda-forge unidock

caic99 avatar Sep 25 '23 06:09 caic99