<?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: Silent runtime failure of kspaceFirstOrder-CUDA, -OMP compiled with gcc &#62;=13.2</title>
		<link>http://www.k-wave.org/forum/topic/silent-runtime-failure-of-kspacefirstorder-cuda-omp-compiled-with-gcc-132</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 22:27:03 +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/silent-runtime-failure-of-kspacefirstorder-cuda-omp-compiled-with-gcc-132" rel="self" type="application/rss+xml" />

		<item>
			<title>Jiri Jaros on "Silent runtime failure of kspaceFirstOrder-CUDA, -OMP compiled with gcc &#62;=13.2"</title>
			<link>http://www.k-wave.org/forum/topic/silent-runtime-failure-of-kspacefirstorder-cuda-omp-compiled-with-gcc-132#post-9174</link>
			<pubDate>Wed, 15 Jan 2025 13:09:51 +0000</pubDate>
			<dc:creator>Jiri Jaros</dc:creator>
			<guid isPermaLink="false">9174@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, we now about and working on releasing the fix. The GNU compiler changed the way it treats infinity. &#60;/p&#62;
&#60;p&#62;The following lines now cause the simulation to end with NaNs.&#60;/p&#62;
&#60;p&#62;if (absorbNabla1[i] == std::numeric_limits&#38;lt;float&#38;gt;::infinity()) absorbNabla1[i] = 0.0f;&#60;br /&#62;
if (absorbNabla2[i] == std::numeric_limits&#38;lt;float&#38;gt;::infinity()) absorbNabla2[i] = 0.0f;&#60;/p&#62;
&#60;p&#62;a simple, however, not the best fix is:&#60;/p&#62;
&#60;p&#62;// Comparison with infinity is not supported with --ffast-math enabled&#60;br /&#62;
if (absorbNabla1[i] &#38;gt;= std::numeric_limits&#38;lt;float&#38;gt;::max()) absorbNabla1[i] = 0.0f;&#60;br /&#62;
if (absorbNabla2[i] &#38;gt;= std::numeric_limits&#38;lt;float&#38;gt;::max()) absorbNabla2[i] = 0.0f;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>aschrempf on "Silent runtime failure of kspaceFirstOrder-CUDA, -OMP compiled with gcc &#62;=13.2"</title>
			<link>http://www.k-wave.org/forum/topic/silent-runtime-failure-of-kspacefirstorder-cuda-omp-compiled-with-gcc-132#post-9144</link>
			<pubDate>Sat, 28 Sep 2024 21:17:20 +0000</pubDate>
			<dc:creator>aschrempf</dc:creator>
			<guid isPermaLink="false">9144@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I can confirm that. Tried to build on macOS (according to &#60;a href=&#34;https://github.com/lennartverhagen/k-Wave-CPUGPU-macOS)&#34; rel=&#34;nofollow&#34;&#62;https://github.com/lennartverhagen/k-Wave-CPUGPU-macOS)&#60;/a&#62;  -- so completely different platform -- with gcc 14 and got always NaN after simulation. Also no error indication during simulation. Simulation on Matlab-Version of kspaceFirstOrder ist pretty stable.&#60;br /&#62;
Thanks for the hint, &#34;rich&#34;. After compiling with gcc 12 everything works as expected!&#60;/p&#62;
&#60;p&#62;Thanks also for the great k-wave SW!&#60;/p&#62;
&#60;p&#62;Kind regards&#60;br /&#62;
Andreas
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vich on "Silent runtime failure of kspaceFirstOrder-CUDA, -OMP compiled with gcc &#62;=13.2"</title>
			<link>http://www.k-wave.org/forum/topic/silent-runtime-failure-of-kspacefirstorder-cuda-omp-compiled-with-gcc-132#post-9112</link>
			<pubDate>Sat, 13 Jul 2024 00:39:08 +0000</pubDate>
			<dc:creator>vich</dc:creator>
			<guid isPermaLink="false">9112@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi there,&#60;/p&#62;
&#60;p&#62;Just passing by to report what I think may be a bug: when I compile kspaceFirstOrder-CUDA (&#60;code&#62;__KWAVE_GIT_HASH__=&#38;quot;468dc31c2842a7df5f2a07c3a13c16c9b0b2b770&#38;quot;&#60;/code&#62;) on Linux with gcc version 13.2.1, the compilation succeeds and the binary runs successfully. But in fact it only appears to run successfully. In some simulations of mine, after running kspaceFirstOrder-CUDA, MATLAB's &#60;code&#62;h5read()&#60;/code&#62; reads in the &#60;code&#62;/p_final&#60;/code&#62; and &#60;code&#62;/p&#60;/code&#62; fields of the output HDF5 file as all-NaN arrays (of the expected size), the three &#60;code&#62;/u[xyz]_non_staggered&#60;/code&#62; as all-zeros arrays, and &#60;code&#62;/p_min&#60;/code&#62; as an array with all entries set to 3.4028e+38 (which equals &#60;code&#62;realmax(&#38;#39;single&#38;#39;)&#60;/code&#62;), for example. The compiled binary produces no unusual messages at runtime.&#60;/p&#62;
&#60;p&#62;However, when I revert to gcc version 12.3.1 and compile kspaceFirstOrder-CUDA anew, keeping all else unchanged, the resulting binary works properly; the output HDF5 file contains meaningful information.&#60;/p&#62;
&#60;p&#62;I tried fiddling with the NVIDIA drivers and the CUDA Toolkit, but I don't think they are to blame. The main reason being (as I found out later) that the kspaceFirstOrder-OMP (&#60;code&#62;__KWAVE_GIT_HASH__=&#38;quot;0ba023063e3f29685e1e346f56883378d961f9f1&#38;quot;&#60;/code&#62;) binary also suffers from the same symptoms (except &#60;code&#62;/p_min&#60;/code&#62; becomes an all-NaN array) when compiled with the more recent gcc 13.2.1; but not with the older gcc 12.3.1.&#60;/p&#62;
&#60;p&#62;I am not sure if that is a problem with my particular system or if the bug can be reproduced elsewhere. Maybe this info can be useful to someone. In any case, though, I think maybe the external binaries could do with some sort of sanity check on the output; something inexpensive, just to catch egregious conditions?&#60;/p&#62;
&#60;p&#62;Thanks for your great software!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
