AutoDock - 编译与测试

1. 准备工作

autodock-gpu

安装cuda,并设置环境变量:

export GPU_INCLUDE_PATH=/usr/local/cuda-11.2/include
export GPU_LIBRARY_PATH=/usr/local/cuda-11.2/lib64
export PATH="/usr/local/cuda-11.2/bin:$PATH"

不同GPU设备下的编译问题

根据不同的GPU设备,选择不同的计算能力ComputeCapability,参考:
https://en.wikipedia.org/wiki/CUDA#GPUs_supported

比如RTX 3090对应的算力是8.6,TARGETS应该是86。

可以修改下面这一行语句,也可以make时增加参数TARGETS="86"

TARGETS = 52 60 61 70 86

确认nvcc是否支持当前的算力参数

如下,nvcc支持compute_86,那么可以设置TARGETS="86"。否则,make时会报错

$ nvcc --help
...
--gpu-code <code>,...                           (-code)                         
        Specify the name of the NVIDIA GPU to assemble and optimize PTX for.
        nvcc embeds a compiled code image in the resulting executable for each specified
        <code> architecture, which is a true binary load image for each 'real' architecture
        (such as sm_50), and PTX code for the 'virtual' architecture (such as compute_50).
        During runtime, such embedded PTX code is dynamically compiled by the CUDA
        runtime system if no binary load image is found for the 'current' GPU.
        Architectures specified for options '--gpu-architecture' and '--gpu-code'
        may be 'virtual' as well as 'real', but the <code> architectures must be
        compatible with the <arch> architecture.  When the '--gpu-code' option is
        used, the value for the '--gpu-architecture' option must be a 'virtual' PTX
        architecture.
        For instance, '--gpu-architecture=compute_60' is not compatible with '--gpu-code=sm_52',
        because the earlier compilation stages will assume the availability of 'compute_60'
        features that are not present on 'sm_52'.
        Note: the values compute_30, compute_32, compute_35, compute_37, compute_50,
        sm_30, sm_32, sm_35, sm_37 and sm_50 are deprecated and may be removed in
        a future release.
        Allowed values for this option:  'compute_35','compute_37','compute_50',
        'compute_52','compute_53','compute_60','compute_61','compute_62','compute_70',
        'compute_72','compute_75','compute_80','compute_86','lto_35','lto_37','lto_50',
        'lto_52','lto_53','lto_60','lto_61','lto_62','lto_70','lto_72','lto_75',
        'lto_80','lto_86','sm_35','sm_37','sm_50','sm_52','sm_53','sm_60','sm_61',
        'sm_62','sm_70','sm_72','sm_75','sm_80','sm_86'.
...

2. 编译

The first step is to set environmental variables GPU_INCLUDE_PATH and GPU_LIBRARY_PATH,
as described here: https://github.com/ccsb-scripps/AutoDock-GPU/wiki/Guideline-for-users

  • Template
make DEVICE=<TYPE> NUMWI=<NWI>
  • Example
make DEVICE=CUDA NUMWI=256 OVERLAP=ON TARGETS="86"
Parameters Description Values
<TYPE> Accelerator chosen CPU, GPU, CUDA, OCLGPU
<NWI> work-group/thread block size, Number of work-items (wi) 1, 2, 4, 8, 16, 32, 64, 128, 256

When DEVICE=GPU is chosen, the Makefile will automatically tests if it can compile Cuda succesfully. To override, use DEVICE=CUDA or DEVICE=OCLGPU. The cpu target is only supported using OpenCL. Furthermore, an OpenMP-enabled overlapped pipeline (for setup and processing) can be compiled with OVERLAP=ON.
Hints: The best work-group size depends on the GPU and workload. Try NUMWI=128 or NUMWI=64 for modern cards with the example workloads. On macOS, use NUMWI=1 for CPUs.

After successful compilation, the host binary autodock_<type>_<N>wi is placed under bin.

Binary-name portion Description Values
<type> Accelerator chosen cpu, gpu
<N> work-group/thread block size 1, 2, 4, 8,16, 32, 64, 128, 256

3. 测试

$ ./autodock_gpu_256wi --lfile /home/shuzhang/ai/code/moldock/autodock/output/tmpnnuuab_g.pdbqt --ffile /data/autodock/grid/0cb544cb1474ff6d917fe409598886cb/protein.maps.fld --devnum 2 --ngen 1 --nrun 2 --stopstd 1.999
AutoDock-GPU version: v1.5.3-73-gf5cf6ffdd0c5b3f113d5cc424fabee51df04da7e

Running 1 docking calculation

Cuda device:                              NVIDIA GeForce RTX 3090 (#2 / 6)
Available memory on device:               21182 MB (total: 24268 MB)

CUDA Setup time 0.248527s
(Thread 52 is setting up Job #1)

Running Job #1
    Using heuristics: (capped) number of evaluations set to 6122449
    Warning: The set number of evals is 48.98% of the uncapped heuristics estimate of 12500000 evals.
             This means this docking may not be able to converge. Increasing --heurmax may improve
             convergence but will also increase runtime.
             AutoStop will not stop before 10.50% (643004) of the set number of evaluations.
    Local-search chosen method is: ADADELTA (ad)

Rest of Setup time 0.006511s

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

Generations |  Evaluations |     Threshold    |  Average energy of best 10%  | Samples | Best Inter + Intra
------------+--------------+------------------+------------------------------+---------+-------------------
          0 |          150 | 1145.95 kcal/mol |  312.45 +/-  222.27 kcal/mol |       4 |   80.37 kcal/mol
          1 |         9167 | 1145.95 kcal/mol |   91.60 +/-  157.57 kcal/mol |      56 |   -7.85 kcal/mol
------------+--------------+------------------+------------------------------+---------+-------------------

                                   Finished evaluation after reaching
                          9167 evaluations. Best inter + intra    -7.85 kcal/mol.

Docking time 0.002292s

Shutdown time 0.002002s

Job #1 took 0.011 sec after waiting 0.347 sec for setup

(Thread 52 is processing Job #1)
Run time of entire job set (1 file): 0.360 sec
Processing time: 0.002 sec

All jobs ran without errors.

4. 参考

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 199,175评论 5 466
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 83,674评论 2 376
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 146,151评论 0 328
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 53,597评论 1 269
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 62,505评论 5 359
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 47,969评论 1 275
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,455评论 3 390
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,118评论 0 254
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,227评论 1 294
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,213评论 2 317
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,214评论 1 328
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,928评论 3 316
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,512评论 3 302
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,616评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,848评论 1 255
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,228评论 2 344
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 41,772评论 2 339

推荐阅读更多精彩内容