{"id":158,"date":"2018-01-18T20:26:48","date_gmt":"2018-01-18T20:26:48","guid":{"rendered":"https:\/\/in.nau.edu\/hpc\/?page_id=158"},"modified":"2024-08-14T08:58:25","modified_gmt":"2024-08-14T15:58:25","slug":"gpu-accelerated-jobs","status":"publish","type":"page","link":"https:\/\/in.nau.edu\/arc\/overview\/using-the-cluster-advanced\/gpu-accelerated-jobs\/","title":{"rendered":"GPU-Accelerated Jobs"},"content":{"rendered":"<!-- shortcode-right-column -->\n<div class=\"shortcode-right-column\" >\n    <div class=\"shortcode-right-column__container\"><\/p>\n<p><!-- shortcode-contact -->\n<div class=\"shortcode-contact\">\n    <div class=\"contact-header\">\n        <h3>Contact Advanced Research Computing<\/h3>\n    <\/div>\n    <div class=\"contact-body\">\n                <a href=\"mailto:ask-arc@nau.edu\" aria-label=\"Contact Advanced Research Computing: Email Address\" title=\"Email Address\">\n            <div class=\"contact-icon-container\">\n                <i class=\"fas fa-envelope\" aria-hidden=\"true\"><\/i>\n                <span class=\"sr-only\">Email:<\/span>\n            <\/div>\n            <div class=\"contact-email\">ask-arc&#8203;@nau.edu<\/div>\n        <\/a>\n                    <\/div>\n<\/div>\n\n<\/p>\n<hr \/>\n<h2>Quick Links<\/h2>\n<ul>\n<li><a href=\"https:\/\/in.nau.edu\/arc\/documentation-page\/\">Monsoon Documentation<\/a><\/li>\n<li><a href=\"https:\/\/in.nau.edu\/arc\/overview\/using-the-cluster-advanced\/job-arrays\/\">Job Arrays<\/a><\/li>\n<li><a href=\"https:\/\/in.nau.edu\/arc\/overview\/efficient-jobs\/\">Job Efficiency<\/a><\/li>\n<\/ul>\n<hr \/>\n<p><\/div>\n<\/div>\n\n<h1>GPU-Accelerated Jobs<\/h1>\n<p>Monsoon supports GPU-accelerated processing for several programs, such as NAMD and AMBER. To utilize the GPUs on the cluster you must do 3 things:<\/p>\n<ol>\n<li>Tell SLURM to use a gpu resource with <span style=\"font-size: 16px; font-family: monospace; border: 1px solid; border-radius: 4px; padding: 0px 4px 0px; border-color: #BBBBBB;\">\u2010\u2010gres=gpu:tesla:&lt;number&gt;<\/span>, where <span style=\"font-size: 16px; font-family: monospace; border: 1px solid; border-radius: 4px; padding: 0px 4px 0px; border-color: #BBBBBB;\">&lt;number&gt;<\/span> is the number of gpu cores you want to use.<\/li>\n<li>Load the CUDA module.<\/li>\n<li>Load your CUDA-enabled (GPU-accelerated) software. Note that not all software on Monsoon supports GPU-acceleration.<\/li>\n<\/ol>\n<p>The following script is an example of a GPU-accelerated NAMD job that utilizes 2 of Monsoon\u2019s 20 GPU cores.<\/p>\n<pre><code>#!\/bin\/bash\r\n#SBATCH --job-name=damd-cuda\r\n#SBATCH --gres=gpu:tesla:2\r\n#SBATCH --output=\/scratch\/abc123\/cuda_test.%J.out\r\n#SBATCH --cpus-per-task=4\r\n\r\nmodule load cuda\r\nmodule load namd\/2.10-cuda\r\n\r\nsrun namd2 +idlepoll +p4\r\n\/home\/abc123\/namd_testing\/apoa1\/apoa1.namd<\/code><\/pre>\n<p>When running NAMD jobs with GPU-acceleration, the <span style=\"font-size: 16px; font-family: monospace; border: 1px solid; border-radius: 4px; padding: 0px 4px 0px; border-color: #BBBBBB;\">+idlepoll<\/span> option is required. The <span style=\"font-size: 16px; font-family: monospace; border: 1px solid; border-radius: 4px; padding: 0px 4px 0px; border-color: #BBBBBB;\">+p4<\/span> option tells NAMD to run 4 processes, which we included because we told SLURM to use 4 cpus (<span style=\"font-size: 16px; font-family: monospace; border: 1px solid; border-radius: 4px; padding: 0px 4px 0px; border-color: #BBBBBB;\">\u2010\u2010cpus-per-task=4<\/span>). Although you do not have to specify multiple processors with namd2 or SLURM, performance may increase significantly if you do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GPU-Accelerated Jobs Monsoon supports GPU-accelerated processing for several programs, such as NAMD and AMBER. To utilize the GPUs on the cluster you must do 3 things: Tell SLURM to use a gpu resource with \u2010\u2010gres=gpu:tesla:&lt;number&gt;, where &lt;number&gt; is the number of gpu cores you want to use. Load the CUDA module. Load your CUDA-enabled (GPU-accelerated) [&hellip;]<\/p>\n","protected":false},"author":76,"featured_media":145,"parent":71,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ring_central_script_selection":"","footnotes":""},"class_list":["post-158","page","type-page","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/users\/76"}],"replies":[{"embeddable":true,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/comments?post=158"}],"version-history":[{"count":7,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages\/158\/revisions"}],"predecessor-version":[{"id":3605,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages\/158\/revisions\/3605"}],"up":[{"embeddable":true,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages\/71"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/media\/145"}],"wp:attachment":[{"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/media?parent=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}