<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hpcguide.tau.ac.il/index.php?action=history&amp;feed=atom&amp;title=Using_GPU</id>
	<title>Using GPU - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://hpcguide.tau.ac.il/index.php?action=history&amp;feed=atom&amp;title=Using_GPU"/>
	<link rel="alternate" type="text/html" href="https://hpcguide.tau.ac.il/index.php?title=Using_GPU&amp;action=history"/>
	<updated>2026-04-15T23:38:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://hpcguide.tau.ac.il/index.php?title=Using_GPU&amp;diff=1415&amp;oldid=prev</id>
		<title>Dvory: Created page with &quot;Please note that if you do not ask for a specific gpu, your code asks by default the first one, which may be busy, or using all its memory. In order to specify a gpu to be use...&quot;</title>
		<link rel="alternate" type="text/html" href="https://hpcguide.tau.ac.il/index.php?title=Using_GPU&amp;diff=1415&amp;oldid=prev"/>
		<updated>2023-05-01T08:32:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Please note that if you do not ask for a specific gpu, your code asks by default the first one, which may be busy, or using all its memory. In order to specify a gpu to be use...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Please note that if you do not ask for a specific gpu, your code asks by default the first one, which may be busy, or using all its memory.&lt;br /&gt;
In order to specify a gpu to be used, please define it (using the environment variable: CUDA_VISIBLE_DEVICES)&lt;br /&gt;
e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export CUDA_VISIBLE_DEVICES=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you would like to use more than 1 gpu, you may type them separated with comma, e.g.&lt;br /&gt;
export CUDA_VISIBLE_DEVICES=&amp;quot;2,4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In order to know which gpus are free, you may copy python script to your disk and activate it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load python/python-anaconda_3.7&lt;br /&gt;
python /powerapps/scripts/check_avail_gpu.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It will output the first free gpu (in its last line)&lt;br /&gt;
If you need more than one gpu, please overwrite parameter num_gpus in line 96&lt;br /&gt;
num_gpus = 1&lt;br /&gt;
Change it to the number you need&lt;/div&gt;</summary>
		<author><name>Dvory</name></author>
	</entry>
</feed>