DeltaGroupNJUPT / Vina-GPU-2.1

Vina-GPU 2.1, an improved docking toolkit for faster speed and higher accuracy on the virtual screening
Apache License 2.0
42 stars 12 forks source link

OpenCL Build kernel 1 from sourceError #3

Closed biogeeker closed 7 months ago

biogeeker commented 8 months ago

Thanks for the wonderful tools, when I use Vina-GPU 2.1, i had an error:

PS C:\Vina-GPU-2.1-main\QuickVina2-GPU-2.1> ./Vina-GPU+_K.exe --config=./input_file_example/2bm2_config.txt
#################################################################
# If you used Vina-GPU in your work, please cite:               #
#                                                               #
#Shidi, Tang, Chen Ruiqi, Lin Mengru, Lin Qingde,               #
#Zhu Yanxiang, Wu Jiansheng, Hu Haifeng, and Ling Ming.         #
#Accelerating AutoDock VINA with GPUs. ChemRxiv (2021).Print.   #
#                                                               #
#DOI 10.26434/chemrxiv-2021-3qvn2-v3                            #
#                                                               #
# And also the origin AutoDock Vina paper:                      #
# O. Trott, A. J. Olson,                                        #
# AutoDock Vina: improving the speed and accuracy of docking    #
# with a new scoring function, efficient optimization and       #
# multithreading, Journal of Computational Chemistry 31 (2010)  #
# 455-461                                                       #
#                                                               #
# DOI 10.1002/jcc.21334                                         #
#                                                               #
#################################################################

Using virtual sreening mode

Output will be in the directory .\test_out
Reading input ... done.
Setting up the scoring function ... done.
Using heuristic search_depth
Analyzing the binding site ... done.
GPU Platform: NVIDIA CUDA
GPU Device: NVIDIA GeForce RTX 3090
Using random seed: 392683864

Build kernel 1 from sourceError: failed to open file
: ./OpenCL/src/kernels/code_head.cpp
OpenCL version: 3.03 errors generated.

Error: Failed to build program executable!
log:<kernel>:1:1: error: expected identifier or '('
@<AA><U+0017>[<F6><U+007F>
^
<kernel>:1:2: error: source file is not valid UTF-8
@<AA><U+0017>[<F6><U+007F>
 ^
<kernel>:1:5: error: source file is not valid UTF-8
@<AA><U+0017>[<F6><U+007F>
              ^

I am not similar to OpenCL, i only found a 'code_head.cl' file, like this:

#include "kernel2.h"

// Macros below are only in device

I don't have solutions for the above errors. Do you have any suggestions?

Meanwhile, no error was encountered when running Qvina2-GPU:

PS C:\QuickVina2-GPU-main\QuickVina2-GPU-main> ./Qvina2_GPU_K.exe --config ./input_file_example/2bm2_config.txt
############################################################################
# If you used QuickVina2-GPU in your work, please cite:                    #
#                                                                          #
# Wang Lingyue, Shidi,Tang, Huang Qinqin,                                 #
# Hu Haifeng, Wu Jiansheng,and Zhu Yanxiang,.                             #
# Fast, Accurate, and Reliable Molecular Docking with QuickVina 2,         #
# Bioinformatics (2015), doi: 10.1093/bioinformatics/btv082                #
# Accelerating Quick Vina2 with GPUs. ChemRxiv (2021).Print.               #
# and original AutoDock Vina paper:                                        #
# O. Trott, A. J. Olson,                                                   #
# AutoDock Vina: improving the speed and accuracy of docking with a        #
# new scoring function, efficient optimization and multithreading,         #
# Journal of Computational Chemistry 31 (2010) 455-461                     #
# doi: 10.1002/jcc.21334                                                   #
############################################################################

Reading input ... done.
Setting up the scoring function ... done.
Analyzing the binding site ... done.
Using random seed: 927683520

Platform: NVIDIA CUDA
Device: NVIDIA GeForce RTX 3090

OpenCL version: 3.0
Search depth is set to 5
 GPU monte carlo runtime: 1.212 s
Refining results ... done.

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
   1         -9.0      0.000      0.000
   2         -8.5      2.400      3.262
   3         -8.4      4.387      6.747
   4         -8.0      5.537      7.659
   5         -8.0      5.553      7.263
   6         -7.8      2.540      5.239
   7         -7.7      3.747      4.824
   8         -7.5      5.341     11.159
Writing output ... done.
Vina-GPU total runtime = 2.587 s

Thanks for your reply!!!

Glinttsd commented 7 months ago

Hi, we are sorry that we mistakenly put the (previous version of Vina-GPU) .exe file into Vina-GPU 2.1 repository. We will build the new version of .exe files soon. But we recommend to run Vina-GPU 2.1 in Linux.

biogeeker commented 7 months ago

Ok, Thanks for your reply, i will try it.

vwcruzeiro commented 3 months ago

Hello @Glinttsd ! I am having a runtime error while running the example provided. I believe it is related to the issue discussed here (see error message below). I am running from Linux. Are you planning to push the .exe for Vina-GPU-2.1 any time soon to this repo? I would appreciate to hear your advice on how to fix my problem. Thanks!

$ ./AutoDock-Vina-GPU-2-1 --config ./input_file_example/2bm2_config.txt 
#################################################################
# If you used AutoDockVina-GPU 2.1 in your work, please cite:   #
#                                                               #
# Ding, Ji, et al. Vina-GPU 2.0: Further Accelerating AutoDock  #
# Vina and Its Derivatives with Graphics Processing Units.      #
# Journal of Chemical Information and Modeling (2023).          #
#                                                               #
# DOI https://doi.org/10.1021/acs.jcim.2c01504                  #
#                                                               #
# Shidi, Tang, Chen Ruiqi, Lin Mengru, Lin Qingde,              #
# Zhu Yanxiang, Wu Jiansheng, Hu Haifeng, and Ling Ming.        #
# Accelerating AutoDock Vina with GPUs.                         #
# Molecules 27.9 (2022): 3041.                                  #
#                                                               #
# DOI https://doi.org/10.3390/molecules27093041                 #
#                                                               #
# And also the origin AutoDock Vina paper:                      #
# O. Trott, A. J. Olson,                                        #
# AutoDock Vina: improving the speed and accuracy of docking    #
# with a new scoring function, efficient optimization and       #
# multithreading, Journal of Computational Chemistry 31 (2010)  #
# 455-461                                                       #
#                                                               #
# DOI 10.1002/jcc.21334                                         #
#                                                               #
#################################################################

Using virtual sreening mode

Output will be in the directory ./test_out
Reading input ... done.
Setting up the scoring function ... done.
Using heuristic search_depth
Analyzing the binding site ... done.
GPU Platform: NVIDIA CUDA
GPU Device: NVIDIA RTX A5000
GPU Device: NVIDIA RTX A5000
GPU Device: NVIDIA RTX A5000
GPU Device: NVIDIA RTX A5000
GPU Device: NVIDIA RTX A5000
GPU Device: NVIDIA RTX A5000
GPU Device: NVIDIA RTX A5000
GPU Device: NVIDIA RTX A5000
Using random seed: 296631858

Build kernel 1 from source
OpenCL version: 3.0
1 error generated.

Error: Failed to build program executable!
log:<kernel>:63:10: error: incompatible pointer types assigning to 'const __global int *' from 'int const __global (*)[1024]'
        address = &(ar->relation[temp]);
                ^ ~~~~~~~~~~~~~~~~~~~~~
Glinttsd commented 3 months ago

Hi @vwcruzeiro, I did not encounter such error before.

I think you can check your driver version/CUDA version or try to compile the code with OpenCL 2.0 (i.e. -DOPENCL_2_0).

We will push the Windows precompiled version soon in this repo.

Thanks for your following.

vwcruzeiro commented 3 months ago

Thank you very much for getting back to me so quickly @Glinttsd ! I have tried multiple CUDA versions (from 10.2 to 12.4) and both OpenCL 2.0 and 3.0. Unfortunately, I got exactly the same error in all cases. Anything else you think I could try? Thanks!

vwcruzeiro commented 3 months ago

Hello @Glinttsd ! I apologize for bothering you. I am still stuck with this issue. Any suggestions? Thanks!

vwcruzeiro commented 3 months ago

Hello @Glinttsd ! I was able to fix the problem by changing address = &(ar->relation[temp]); to address = ar->relation[temp]; in OpenCL/src/kernels/kernel1.cl. I was able to run the test input file now. However, I do see some differences in the output files. For example, here:

REMARK VINA RESULT:      -5.4      1.303      1.579

The two last numbers are completely different. What do they mean?

Thanks for your help!

Glinttsd commented 3 months ago

Hello @Glinttsd ! I was able to fix the problem by changing address = &(ar->relation[temp]); to address = ar->relation[temp]; in OpenCL/src/kernels/kernel1.cl. I was able to run the test input file now. However, I do see some differences in the output files. For example, here:

REMARK VINA RESULT:      -5.4      1.303      1.579

The two last numbers are completely different. What do they mean?

Thanks for your help!

Hi, sorry for the late response. According to your issue, I think you can try to change address = &(ar->relation[temp]); to address = &(ar->relation[temp][0]);.

Hope it works!

vwcruzeiro commented 2 months ago

Hello @Glinttsd ! I am wondering if you have any suggestions on how I can test the codes to make sure that the results are correct. As I mentioned in my previous message, I am getting a few discrepancies in the output files that I do not know how to interpret. Thank you so much!