在集群中使用虚拟化技术

六、singularity之GPU--amber的cuda的北极星版本使用和使用容器编译的amber的cuda版本(一)

2022-12-10 10:27:21 admin 201

六、singularity中使用之GPU--amber的cuda的北极星版本使用和使用容器编译的amber的cuda版本(一)

(一)amber的cuda的北极星版本使用

1、使用五(二)部分的镜像,ambermd

使用北极星amber配置

 vi  ambermd/environment

#!/bin/sh

# Copyright (c) Contributors to the Apptainer project, established as

#   Apptainer a Series of LF Projects LLC.

#   For website terms of use, trademark policy, privacy policy and other

#   project policies see https://lfprojects.org/policies

# Copyright (c) 2018-2021, Sylabs Inc. All rights reserved.

# This software is licensed under a 3-clause BSD license. Please consult

# https://github.com/apptainer/apptainer/blob/main/LICENSE.md regarding your

# rights to use or distribute this software.


# Custom environment shell code should follow

source /appsnew/source/amber18-intel2019-cuda10.1.sh


2、使用五(二)部分md9gpu文件

3、进入md9gpu

ssh debuggpu01 ##或者在login12上也可以

cd md9gpu

source /appsnew/source/intel2019.sh 

source /appsnew/source/cuda-10.1.sh

mpirun -n 1 singularityrun  -B /appsnew/   --nv  ../ambermd pmemd.cuda.MPI -O -i md.in  -o md1.out -p 1tcew.prmtop -c den.rst -r md1.rst -x md1.mdcrd &

注意:其中--nv 为nvidia显卡的环境,加上这个参数会将北极星环境中的gpu参数带过去

然后执行nvidia-smi查看任务是否在跑

图片关键词

查看md1.out输出

图片关键词

有输后,按ctrl+c 结束跟踪

然后快速杀掉程序,因为这个是测试下gpu跑起来没有,kill -9 223038

4、创建脚本


[gao_pkuhpc@login12 md9gpu]$ cat job-g4c.srp 

#!/bin/bash

#SBATCH -J sle003216

#SBATCH -p gpu_4l

#SBATCH -N 1 

#SBATCH -o sle003216_%j.out

#SBATCH -e sle003216_%j.err

#SBATCH --no-requeue

#SBATCH -A gao_g1

#SBATCH --qos=gaog4c

#SBATCH --gres=gpu:1

#SBATCH --overcommit

#SBATCH --mincpus=7

source /appsnew/source/intel2019.sh 

source /appsnew/source/cuda-10.1.sh

mpirun -n 1 singularityrun  -B /appsnew/   --nv  ../ambermd pmemd.cuda.MPI -O -i md.in  -o md1.out -p 1tcew.prmtop -c den.rst -r md1.rst -x md1.mdcrd 

提交任务:


图片关键词

跟踪任务:

图片关键词


(二)使用容器编译的amber的cuda版本

1、安装

参见五部分的(二)

2、更改适配环境

vi  ambermd/environment

#!/bin/sh

# Copyright (c) Contributors to the Apptainer project, established as

#   Apptainer a Series of LF Projects LLC.

#   For website terms of use, trademark policy, privacy policy and other

#   project policies see https://lfprojects.org/policies

# Copyright (c) 2018-2021, Sylabs Inc. All rights reserved.

# This software is licensed under a 3-clause BSD license. Please consult

# https://github.com/apptainer/apptainer/blob/main/LICENSE.md regarding your

# rights to use or distribute this software.


# Custom environment shell code should follow

source /appsnew/source/intel2019.sh

source /appsnew/source/cuda-10.1.sh

source /amber18/amber.sh

3、编辑脚本

脚本同前面的一样(一),原因是更改了 ambermd/environment的指定的pmemd.cuda.MPI,见前面红字部分

4、提交任务同前面,这里不再展示




报错,这个错误大家看看就可以:

[gao_pkuhpc@login12 md9gpu]$ cat sle003216_16599657.err 

/appsnew/opt/intel/intel2019/compilers_and_libraries_2019.4.243/linux/mpi/intel64/bin/mpirun: line 103: 94411 Segmentation fault      (core dumped) mpiexec.hydra "$@" 0<&0

图片关键词

这种应该是 集群没有建立正确的 resolv.conf文件



首页
资源&收费
集群
成果
问答