{"id":479,"date":"2021-02-06T21:00:07","date_gmt":"2021-02-07T02:00:07","guid":{"rendered":"https:\/\/psycomp.utsc.utoronto.ca\/support\/?p=479"},"modified":"2021-02-06T19:53:29","modified_gmt":"2021-02-07T00:53:29","slug":"start-a-gpu-slurm-session","status":"publish","type":"post","link":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/2021\/02\/06\/start-a-gpu-slurm-session\/","title":{"rendered":"Start a GPU Slurm session"},"content":{"rendered":"<strong>&#8220;gpudebug&#8221; partition is for debugging GPU applications only. A &#8220;gpudebug&#8221; command is available for starting a Slurm session.<\/strong><br\/>\r\nThe following command (email address is optional) will get you a Slurm session with 12 CPU cores, 12GB CPU memory and 1 x GPU card (Nvidia T4):\r\n<pre>\r\ngpudbug [YOUR-EMAIL-ADDRESS]\r\n<\/pre>\r\n<strong>&#8220;gpu&#8221; Slurm partition can be used with or without allocating a GPU card.<\/strong><br\/>\r\nTo start a GUI &#8220;gpu&#8221; Slurm session with a GPU card and 20 CPU cores, and receiving email notifications from Slurm, for example, you can use the following command:\r\n<pre>\r\nsrun -p gpu --gpus=1 -c 20 --mail-type=ALL --mail-user=YOUR-EMAIL-ADDRESS --x11 --pty bash -i\r\n<\/pre>\r\n<strong>To start a non-GUI &#8220;gpu&#8221; Slurm session with 20 CPU cores only, for example, you can use the following command:<\/strong>\r\n<pre>\r\nsrun -p gpu -c 20 --pty bash -i\r\n<\/pre>\r\nThe following sbatch script example asks for 1 GPU, 20 CPU cores and 40Gb RAM:\r\n<pre>\r\n#!\/bin\/bash\r\n#SBATCH --job-name=\"slurmGpuTest\"\r\n#SBATCH --partition=gpu\r\n#SBATCH --nodes=1\r\n#SBATCH --ntasks=1\r\n#SBATCH --cpus-per-task=20\r\n#SBATCH --mem=40000\r\n#SBATCH --gpus=1\r\n#SBATCH --output=slurmGpuTest.out\r\n#SBATCH --mail-user=YOUR-EMAIL-ADDRESS\r\n#SBATCH --mail-type=ALL\r\n\r\n##SBATCH --time=00:15:00\r\n##SBATCH --requeue      #Specifies that the job will be requeued after a node failure.The default is that the job will not be requeued.\r\n##SBATCH --checkpoint=1:0:0\r\n\r\nhostname\r\ndate +'%y-%m-%d %H:%M:%S'\r\nwhich python\r\npython --version\r\nmodule load python\r\nwhich python\r\npython --version\r\nmodule unload python\r\nwhich python\r\npython --version\r\ndate +'%y-%m-%d %H:%M:%S'\r\nsleep 100\r\ndate +'%y-%m-%d %H:%M:%S'\r\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>&#8220;gpudebug&#8221; partition is for debugging GPU applications only. A &#8220;gpudebug&#8221; command is available for starting a Slurm session. The following command (email address is optional) will get you a Slurm session with 12 CPU cores, 12GB CPU memory and 1 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/2021\/02\/06\/start-a-gpu-slurm-session\/\"> <span class=\"screen-reader-text\">Start a GPU Slurm session<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[3,7,2,10],"tags":[],"class_list":["post-479","post","type-post","status-publish","format-standard","hentry","category-clusterinfo","category-linuxshell","category-quickstart","category-slurm"],"_links":{"self":[{"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/posts\/479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/comments?post=479"}],"version-history":[{"count":10,"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/posts\/479\/revisions"}],"predecessor-version":[{"id":523,"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/posts\/479\/revisions\/523"}],"wp:attachment":[{"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/media?parent=479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/categories?post=479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/psycomp.utsc.utoronto.ca\/support\/index.php\/wp-json\/wp\/v2\/tags?post=479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}