ccsb-scripps / AutoDock-GPU

AutoDock for GPUs and other accelerators
https://ccsb.scripps.edu/autodock
GNU General Public License v2.0
366 stars 101 forks source link

void gpu_gradient_minAD #260

Open Yuwei-Pan opened 2 months ago

Yuwei-Pan commented 2 months ago

Hello,

I am trying to run a docking of a receptor whose structure was obtained from protein data bank. I deleted all the water and heteroatoms and followed the receptor processing tutorial in AutoDock-Vina. However, I keep getting the following error even when I tried multiple ways of preparing the grid map files.

Running Job #1 Using heuristics: (capped) number of evaluations set to 244898 Local-search chosen method is: ADADELTA (ad)

Rest of Setup time 0.264910s

Executing docking runs, stopping automatically after either reaching 0.15 kcal/mol standard deviation of the best molecules of the last 4 * 5 generations, 42000 generations, or 244898 evaluations:

Generations | Evaluations | Threshold | Average energy of best 10% | Samples | Best Inter + Intra ------------+--------------+------------------+------------------------------+---------+------------------- 0 | 150 | -1.51 kcal/mol | -1.99 +/- 0.33 kcal/mol | 8 | -2.82 kcal/mol autodock_gpu_128wi_a40: ./cuda/kernel_ad.cu:404: void gpu_gradient_minAD(uint32_t, uint32_t, float, float): Assertion `0' failed.

I tried running the docking with the examples provided, and they were fine. I wonder what I'm doing wrong. Thank you!

rwxayheee commented 2 months ago

Hi @Yuwei-Pan Can you kindly share your input files (ligand PDBQT, map FLD, GPF, and DPF, if you use them) and hardware information? It seems like gpu_gradient_minAD couldn't minimize the next generations at some step, but I'm not sure about the exact cause. Having the input files would be tremendously useful for others to reproduce this issue

atillack commented 2 months ago

@Yuwei-Pan Which version of AD-GPU are you using and what GPU are you running on?

atillack commented 2 months ago

@Yuwei-Pan Also, one thing to try is to run the AD-GPU OpenCL version using make DEVICE=OCLGPU NUMWI=128 OVERLAP=ON. While Cuda and OpenCL should be functionally similar there may be some slight differences.

Yuwei-Pan commented 2 months ago

Hi @Yuwei-Pan Can you kindly share your input files (ligand PDBQT, map FLD, GPF, and DPF, if you use them) and hardware information? It seems like gpu_gradient_minAD couldn't minimize the next generations at some step, but I'm not sure about the exact cause. Having the input files would be tremendously useful for others to reproduce this issue

The ligand PDBQT:

REMARK  Name = .\14207ds.pdb
REMARK  9 active torsions:
REMARK  status: ('A' for Active; 'I' for Inactive)
REMARK    1  A    between atoms: _1  and  _11
REMARK    2  A    between atoms: _1  and  _20
REMARK    3  A    between atoms: _4  and  _24
REMARK    4  A    between atoms: _6  and  _14
REMARK    5  A    between atoms: _8  and  _15
REMARK    6  A    between atoms: _8  and  _25
REMARK    7  A    between atoms: _12  and  _24
REMARK    8  A    between atoms: _13  and  _16
REMARK    9  A    between atoms: _17  and  _29
REMARK                            x       y       z     vdW  Elec       q    Type
REMARK                         _______ _______ _______ _____ _____    ______ ____
ROOT
ATOM      3  C   UNL     1      10.266   2.510   7.756  0.00  0.00    +0.085 A 
ATOM      4  C   UNL     1      11.600   2.927   7.779  0.00  0.00    +0.179 A 
ATOM      7  C   UNL     1      11.995   4.026   7.001  0.00  0.00    +0.188 A 
ATOM     10  C   UNL     1      11.026   4.686   6.230  0.00  0.00    +0.138 A 
ATOM     11  N   UNL     1       9.744   4.280   6.192  0.00  0.00    -0.233 NA
ATOM     18  CA  UNL     1       9.395   3.224   6.919  0.00  0.00    +0.165 A 
ENDROOT
BRANCH  10  12
ATOM     12  C   UNL     1      11.370   5.825   5.378  0.00  0.00    +0.131 A 
ATOM     13  C   UNL     1      12.537   6.484   5.191  0.00  0.00    +0.227 A 
ATOM     14  O   UNL     1      12.329   7.458   4.240  0.00  0.00    -0.447 OA
ATOM     15  C   UNL     1      11.027   7.346   3.891  0.00  0.00    +0.193 A 
ATOM     16  C   UNL     1      10.500   8.266   2.857  0.00  0.00    +0.109 C 
ATOM     17  N   UNL     1      10.407   6.399   4.526  0.00  0.00    -0.212 NA
ENDBRANCH  10  12
BRANCH   3   1
ATOM      1  S   UNL     1       9.699   1.088   8.651  0.00  0.00    -0.123 S 
ATOM      2  C   UNL     1       8.858   1.887  10.053  0.00  0.00    +0.090 C 
ENDBRANCH   3   1
BRANCH   4   5
ATOM      5  O   UNL     1      12.592   2.263   8.443  0.00  0.00    -0.490 OA
ATOM      6  C   UNL     1      12.679   2.468   9.833  0.00  0.00    +0.277 C 
ENDBRANCH   4   5
BRANCH   7   8
ATOM      8  O   UNL     1      13.268   4.468   6.969  0.00  0.00    -0.502 OA
ATOM      9  H   UNL     1      13.836   3.910   7.238  0.00  0.00    +0.292 HD
ENDBRANCH   7   8
BRANCH  18  19
ATOM     19  C   UNL     1       7.939   2.838   6.769  0.00  0.00    +0.357 C 
ATOM     20  OXT UNL     1       7.102   3.184   7.583  0.00  0.00    -0.243 OA
BRANCH  19  21
ATOM     21  O   UNL     1       7.705   2.162   5.679  0.00  0.00    -0.476 OA
ATOM     22  H   UNL     1       6.845   2.035   5.590  0.00  0.00    +0.295 HD
ENDBRANCH  19  21
ENDBRANCH  18  19
TORSDOF 6

The map FLD file:

# AVS field file
#
# AutoDock Atomic Affinity and Electrostatic Grids
#
# Created by ./autogrid4.
#
#SPACING 0.375
#NELEMENTS 240 240 240
#CENTER 40.649 37.366 48.500
#MACROMOLECULE 1o8a.pdbqt
#GRID_PARAMETER_FILE 1o8a.gpf
#
ndim=3          # number of dimensions in the field
dim1=241            # number of x-elements
dim2=241            # number of y-elements
dim3=241            # number of z-elements
nspace=3        # number of physical coordinates per point
veclen=15       # number of affinity values at each point
data=float      # data type (byte, integer, float, double)
field=uniform       # field type (uniform, rectilinear, irregular)
coord 1 file=1o8a.maps.xyz filetype=ascii offset=0
coord 2 file=1o8a.maps.xyz filetype=ascii offset=2
coord 3 file=1o8a.maps.xyz filetype=ascii offset=4
label=HD-affinity   # component label for variable 1
label=C-affinity    # component label for variable 2
label=A-affinity    # component label for variable 3
label=N-affinity    # component label for variable 4
label=NA-affinity   # component label for variable 5
label=OA-affinity   # component label for variable 6
label=F-affinity    # component label for variable 7
label=P-affinity    # component label for variable 8
label=SA-affinity   # component label for variable 9
label=S-affinity    # component label for variable 10
label=Cl-affinity   # component label for variable 11
label=Br-affinity   # component label for variable 12
label=I-affinity    # component label for variable 13
label=Electrostatics    # component label for variable 13
label=Desolvation   # component label for variable 14
#
# location of affinity grid files and how to read them
#
variable 1 file=1o8a.HD.map filetype=ascii skip=6
variable 2 file=1o8a.C.map filetype=ascii skip=6
variable 3 file=1o8a.A.map filetype=ascii skip=6
variable 4 file=1o8a.N.map filetype=ascii skip=6
variable 5 file=1o8a.NA.map filetype=ascii skip=6
variable 6 file=1o8a.OA.map filetype=ascii skip=6
variable 7 file=1o8a.F.map filetype=ascii skip=6
variable 8 file=1o8a.P.map filetype=ascii skip=6
variable 9 file=1o8a.SA.map filetype=ascii skip=6
variable 10 file=1o8a.S.map filetype=ascii skip=6
variable 11 file=1o8a.Cl.map filetype=ascii skip=6
variable 12 file=1o8a.Br.map filetype=ascii skip=6
variable 13 file=1o8a.I.map filetype=ascii skip=6
variable 14 file=1o8a.e.map filetype=ascii skip=6
variable 15 file=1o8a.d.map filetype=ascii skip=6

The GPF file:

npts 240 240 240
gridfld 1o8a.maps.fld
spacing 0.375
receptor_types A C HD N OA SA
ligand_types HD C A N NA OA F P SA S Cl Br I
receptor 1o8a.pdbqt
gridcenter 40.649 37.366 48.500
smooth 0.5
map         1o8a.HD.map
map         1o8a.C.map
map         1o8a.A.map
map         1o8a.N.map
map         1o8a.NA.map
map         1o8a.OA.map
map         1o8a.F.map
map         1o8a.P.map
map         1o8a.SA.map
map         1o8a.S.map
map         1o8a.Cl.map
map         1o8a.Br.map
map         1o8a.I.map
elecmap     1o8a.e.map
dsolvmap    1o8a.d.map
dielectric -0.1465

I didn't use a DPF file. The hardware that I'm using is NVIDIA A40. Thank you!

Yuwei-Pan commented 2 months ago

@Yuwei-Pan Which version of AD-GPU are you using and what GPU are you running on?

I'm using autodock_gpu_128wi and I'm running on NVIDIA A40.

rwxayheee commented 2 months ago

Hi @Yuwei-Pan Could you post the version, kernel and device information (usually printed at the beginning of the output)? The dev @atillack might be able to provide better advice

npts 240 240 240

This is a really large box and can encompass the entire protein. Have you tried reducing the size of the box (maybe to 40, 40, 40) and see if that works?

rwxayheee commented 2 months ago

Hey @Yuwei-Pan

I was able to reproduce this and I think the reason is the ordering of atoms in the ligand PDBQT file, as @diogomart commented in #224. It worked just fine in the 240x240x240 box with this ligand PDBQT file

REMARK  6 active torsions:
REMARK  status: ('A' for Active; 'I' for Inactive)
REMARK    1  A    between atoms: CA_3  and  C_14 
REMARK    2  A    between atoms: C_4  and  S_20 
REMARK    3  A    between atoms: C_5  and  O_16 
REMARK    4  A    between atoms: C_6  and  O_17 
REMARK    5  A    between atoms: C_7  and  C_8 
REMARK    6  A    between atoms: C_14  and  O_18 
ROOT
ATOM      1  N   UNL     1       9.744   4.280   6.192  0.00  0.00    -0.235 NA
ATOM      2  CA  UNL     1       9.395   3.224   6.919  0.00  0.00     0.150 A 
ATOM      3  C   UNL     1      10.266   2.510   7.756  0.00  0.00     0.073 A 
ATOM      4  C   UNL     1      11.600   2.927   7.779  0.00  0.00     0.125 A 
ATOM      5  C   UNL     1      11.995   4.026   7.001  0.00  0.00     0.132 A 
ATOM      6  C   UNL     1      11.026   4.686   6.230  0.00  0.00     0.125 A 
ENDROOT
BRANCH   6   7
ATOM      7  C   UNL     1      11.370   5.825   5.378  0.00  0.00     0.127 A 
ATOM      8  N   UNL     1      10.407   6.399   4.526  0.00  0.00    -0.222 NA
ATOM      9  C   UNL     1      11.027   7.346   3.891  0.00  0.00     0.159 A 
ATOM     10  O   UNL     1      12.329   7.458   4.240  0.00  0.00    -0.289 OA
ATOM     11  C   UNL     1      10.500   8.266   2.857  0.00  0.00     0.080 C 
ATOM     12  C   UNL     1      12.537   6.484   5.191  0.00  0.00     0.145 A 
ENDBRANCH   6   7
BRANCH   5  13
ATOM     13  O   UNL     1      13.268   4.468   6.969  0.00  0.00    -0.356 OA
ATOM     14  H   UNL     1      13.836   3.910   7.238  0.00  0.00     0.218 HD
ENDBRANCH   5  13
BRANCH   2  15
ATOM     15  C   UNL     1       7.939   2.838   6.769  0.00  0.00     0.197 C 
ATOM     16  OXT UNL     1       7.102   3.184   7.583  0.00  0.00    -0.645 OA
BRANCH  15  17
ATOM     17  O   UNL     1       7.705   2.162   5.679  0.00  0.00    -0.772 OA
ATOM     18  H   UNL     1       6.845   2.035   5.590  0.00  0.00     0.167 HD
ENDBRANCH  15  17
ENDBRANCH   2  15
BRANCH   4  19
ATOM     19  O   UNL     1      12.592   2.263   8.443  0.00  0.00    -0.326 OA
ATOM     20  C   UNL     1      12.679   2.468   9.833  0.00  0.00     0.181 C 
ENDBRANCH   4  19
BRANCH   3  21
ATOM     21  S   UNL     1       9.699   1.088   8.651  0.00  0.00    -0.109 SA
ATOM     22  C   UNL     1       8.858   1.887  10.053  0.00  0.00     0.074 C 
ENDBRANCH   3  21
TORSDOF 6

A quick way to remake ligand PDBQT is to run prepare_ligand on your original PDBQT

./prepare_ligand -l original_ligand.pdbqt -o ordered.pdbqt

atillack commented 2 months ago

Great, thank you for the following up!

Yuwei-Pan commented 2 months ago

Hi @rwxayheee

I tried your suggestion, and it worked well. Thank you very much!