<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: Multiple GPUs, k-Wave 1.1</title>
		<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 22:28:57 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/multiple-gpus-k-wave-11" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Multiple GPUs, k-Wave 1.1"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11#post-7864</link>
			<pubDate>Mon, 05 Oct 2020 09:24:14 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7864@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi qzshi,&#60;/p&#62;
&#60;p&#62;The best way with the current version of k-Wave is to use the native GPU code by calling &#60;code&#62;kspaceFirstOrder3DG&#60;/code&#62; with the optional input &#60;code&#62;&#38;#39;DeviceNum&#38;#39;&#60;/code&#62; set to 0 or 1 (etc). You don't need to call &#60;code&#62;gpuDevice&#60;/code&#62; from within MATLAB.&#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>qzshi on "Multiple GPUs, k-Wave 1.1"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11#post-7863</link>
			<pubDate>Fri, 02 Oct 2020 04:21:36 +0000</pubDate>
			<dc:creator>qzshi</dc:creator>
			<guid isPermaLink="false">7863@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;hi, Brad&#60;/p&#62;
&#60;p&#62;I use the function gpuDevice(1) and gpuDevice(2) on two matlab sessions, but when I run the function kspaceFirstOrder2DG respectively, only one GPU(GPU 0 of 8 GPU) is selected on both two matlab sessions.&#60;/p&#62;
&#60;p&#62;So, is it right for this approach to call multiple GPUs?&#60;/p&#62;
&#60;p&#62;best regards&#60;br /&#62;
qzshi
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Multiple GPUs, k-Wave 1.1"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11#post-4949</link>
			<pubDate>Thu, 22 Jan 2015 22:00:58 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4949@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Andy,&#60;/p&#62;
&#60;p&#62;In the &#60;a href=&#34;http://www.k-wave.org/documentation/example_us_bmode_linear_transducer.php&#34;&#62;Simulating B-mode Ultrasound Images Example&#60;/a&#62;, the simulated ultrasound image is formed by performing multiple k-Wave simulations. These can be performed separately (with separate calls to &#60;code&#62;kspaceFirstOrder3D&#60;/code&#62;), and thus can be run on different GPUs. &#60;/p&#62;
&#60;p&#62;If you want to do the same thing running multiple 2D simulations, this can be done in the same way. However, it is not possible to split a single simulation over multiple GPUs. The main reason is that the simulations rely on the FFT, which requires an all-to-all communication. This becomes very slow when data has to pass along the PCIe links between the GPUs (if you're interested, you can read more about this &#60;a href=&#34;http://www.homepages.ucl.ac.uk/~rmapbtr/papers/CONF_11_2012_Nandapalan_PDCAT_MultiGPU.pdf&#34;&#62;here&#60;/a&#62;).&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>acarlson on "Multiple GPUs, k-Wave 1.1"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11#post-4939</link>
			<pubDate>Fri, 16 Jan 2015 20:38:55 +0000</pubDate>
			<dc:creator>acarlson</dc:creator>
			<guid isPermaLink="false">4939@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Johan and Brad,&#60;/p&#62;
&#60;p&#62;I was wondering if there is a way to &#34;split&#34; the example file kspaceFirstOrder2D? I think I followed the original post of splitting into scan lines, but it is not as clear if is possible to do this with firstorder2d problem&#60;/p&#62;
&#60;p&#62;I would appreciate any help, I currently have the following hardware, and was hoping to utilize multipe GPU's, if possible.&#60;/p&#62;
&#60;p&#62;(2X) 12-core Xeon E5-2680v3 CPUs&#60;br /&#62;
(2x) NVIDIA Tesla K40's&#60;br /&#62;
128GB DDR4 2133MHz Memory&#60;/p&#62;
&#60;p&#62;The system has Scientific Linux 6.5 with NVIDIA CUDA and MATLAB R2014b &#60;/p&#62;
&#60;p&#62;Andy
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Multiple GPUs, k-Wave 1.1"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11#post-4811</link>
			<pubDate>Sat, 01 Nov 2014 11:32:44 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4811@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Johan,&#60;/p&#62;
&#60;p&#62;Thanks for the update, very interesting. Glad to see you got it working!&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ceke on "Multiple GPUs, k-Wave 1.1"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11#post-4788</link>
			<pubDate>Thu, 23 Oct 2014 19:07:45 +0000</pubDate>
			<dc:creator>ceke</dc:creator>
			<guid isPermaLink="false">4788@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Oh, it might be possible to run this in one MATLAB session if you can execute the two scripts with directing the to two different MATLAB workers using something like:&#60;/p&#62;
&#60;p&#62;parpool(2);&#60;br /&#62;
parfor gpu = 1:2,&#60;br /&#62;
  if gpu == 1,&#60;br /&#62;
    gpuDevice(1)&#60;br /&#62;
  else&#60;br /&#62;
    gpuDevice(2)&#60;br /&#62;
  end&#60;br /&#62;
  run_the_simulation_script&#60;br /&#62;
end&#60;br /&#62;
parpool close;&#60;/p&#62;
&#60;p&#62;I have had some problems, though, since the parfor construction doesn't work so well with struct variables. The solution was to write a wrapper function for the kspace...  with all individual struct fields as separate arguments, and then call this wrapper from parfor. Then, inside the wrapper, re-pack the struct and call the k-wave function.&#60;/p&#62;
&#60;p&#62;Haven't tried the trick above, but I can't see why it shouldn't work. &#60;/p&#62;
&#60;p&#62;Cheers,&#60;br /&#62;
/Johan
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ceke on "Multiple GPUs, k-Wave 1.1"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11#post-4787</link>
			<pubDate>Thu, 23 Oct 2014 18:55:37 +0000</pubDate>
			<dc:creator>ceke</dc:creator>
			<guid isPermaLink="false">4787@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thanks for the quick response, almost too quick for me :-)&#60;/p&#62;
&#60;p&#62;So, below is what I tried, which appears to be working fine:&#60;/p&#62;
&#60;p&#62;1) I took the script &#34;example_us_bmode_linear_transducer.m&#34; and split it into two parts, where the for loop for the simulation is split so that the scripts take half of the scan lines each and then save the results in separate .mat files.&#60;/p&#62;
&#60;p&#62;2) I started two MATLAB sessions and called gpuDevice(1) in the first and gpuDevice(2) in the other. &#60;/p&#62;
&#60;p&#62;3) In a terminal windows I typed nvidia-smi a few times to see what happened to memory usage and it seems like it uses about 750-780 MB of GPU RAM on each, and that the GPU temperature slowly ramps up on both.&#60;/p&#62;
&#60;p&#62;When starting the first MATLAB session the estimated computation time was about 1.5 minutes/scan line. When starting the second session (on the other GPU) it first increased to 2.5 minurts/scan line, but after a minute or so they both dropped back down to 1.5.&#60;/p&#62;
&#60;p&#62;All in all, it appears that the speedup of this scheme is about two times when adding the extra GPU.&#60;/p&#62;
&#60;p&#62;For your reference, I'm running a system with:&#60;br /&#62;
1) Intel Xeon CPU E5-1650 v2 @ 3.5 GHz   (6 cores in HyperThreading -&#38;gt; 12 threads)&#60;br /&#62;
2) 64 GB of RAM&#60;br /&#62;
3) GeForce GTX Titan Z with dual GPUs with 6 GB of GPU RAM each&#60;br /&#62;
4) Ubuntu 14.04.1 LTS (x64)&#60;br /&#62;
5) MATLAB 2014a with the Parallel Computing Toolbox&#60;br /&#62;
6) NVIDIA Driver version 343.22 (v. 6.5)&#60;br /&#62;
7) NVIDIA Toolkit v. 5.5&#60;/p&#62;
&#60;p&#62;Many thanks!&#60;br /&#62;
/Johan
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Multiple GPUs, k-Wave 1.1"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11#post-4776</link>
			<pubDate>Sun, 19 Oct 2014 21:58:00 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4776@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Johan,&#60;/p&#62;
&#60;p&#62;You can use the MATLAB function &#60;code&#62;gpuDevice&#60;/code&#62; with no inputs to query which device is currently selected, and then &#60;code&#62;gpuDevice(1)&#60;/code&#62; or &#60;code&#62;gpuDevice(2)&#60;/code&#62; (etc) to select which one you'd like to use. I've not tried using multiple GPU devices with multiple MATLAB sessions, so I'd be interested to know if you can get it to work.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ceke on "Multiple GPUs, k-Wave 1.1"</title>
			<link>http://www.k-wave.org/forum/topic/multiple-gpus-k-wave-11#post-4775</link>
			<pubDate>Sun, 19 Oct 2014 20:23:46 +0000</pubDate>
			<dc:creator>ceke</dc:creator>
			<guid isPermaLink="false">4775@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;So, I just installed k-Wave 1.1 on my Ubuntu 14.04 (x64) system. It features a GTX Titan Z dual GPU card, with 6 GB of GPU memory per GPU.&#60;/p&#62;
&#60;p&#62;Running, for example 'example_us_bmode_phased_array.m' with data_cast = 'gpuArray-single' works, out of the box. It does, however, only use one of the GPUs.&#60;/p&#62;
&#60;p&#62;I tried starting two MATLAB sessions, and then launching two separate MATLAB scripts like the example above, hoping that the OS would schedule the second job to the other GPU (since the first one was already working at full load). This was not the case.&#60;/p&#62;
&#60;p&#62;So, now to the question: How can I direct my scripts to a specific GPU in the case I have more than one?&#60;/p&#62;
&#60;p&#62;I run the Parallel Computing Toolbox, but none of the other GPU solutions (except, of course, for NVIDIAs drivers and toolkit).&#60;/p&#62;
&#60;p&#62;Best regards,&#60;br /&#62;
/Johan
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
