Skip to content

Issues of compile in /example/turbulece/channel3d running in GPU

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Issues of compile in /example/turbulece/channel3d running in GPU

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8001
    Yuji
    Participant

    Dear Adrian,
    I got some error in channel3D using nvcc, and fixed this error following this post(https://www.openlb.net/forum/topic/issues-with-time-averaged-velocity-field-in-turbulence-model-running-in-gpu/). Thank you.
    However I got additional error that I cannot solve. How can I solve it?
    error is below;
    `

    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp: In function ‘double rcbrt(double)’:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:2960:34: error: call of overloaded ‘log2(double&)’ is ambiguous
    2960 | t = exp2(-CUDART_THIRD * log2(s)); /* initial approximation */
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:133:15: note: candidate: ‘double log2(double)’
    133 | __MATHCALL (log2,, (_Mdouble_ __x));
    | ^~~~
    /usr/include/c++/9/cmath:1574:23: note: candidate: ‘constexpr long double std::log2(long double)’
    1574 | log2(long double __x)
    | ^
    /usr/include/c++/9/cmath:1570:17: note: candidate: ‘constexpr float std::log2(float)’
    1570 | log2(float __x)
    | ^
    ../../../src/utilities/omath.h:189:14: note: candidate: ‘float olb::util::log2(float)’
    189 | inline float log2(float arg)
    | ^~~~
    ../../../src/utilities/omath.h:199:15: note: candidate: ‘double olb::util::log2(double)’
    199 | inline double log2(double arg)
    | ^~~~
    ../../../src/utilities/omath.h:204:20: note: candidate: ‘long double olb::util::log2(long double)’
    204 | inline long double log2(long double arg)
    | ^~~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp: In function ‘double sinpi(double)’:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:2981:18: error: call of overloaded ‘sin(double&)’ is ambiguous
    2981 | return sin (a);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:64:15: note: candidate: ‘double sin(double)’
    64 | __MATHCALL_VEC (sin,, (_Mdouble_ __x));
    | ^~~
    /usr/include/c++/9/cmath:429:23: note: candidate: ‘constexpr long double std::sin(long double)’
    429 | sin(long double __x)
    | ^
    /usr/include/c++/9/cmath:425:17: note: candidate: ‘constexpr float std::sin(float)’
    425 | sin(float __x)
    | ^
    ../../../src/utilities/omath.h:276:14: note: candidate: ‘float olb::util::sin(float)’
    276 | inline float sin(float arg)
    | ^~~
    ../../../src/utilities/omath.h:286:15: note: candidate: ‘double olb::util::sin(double)’
    286 | inline double sin(double arg)
    | ^~~
    ../../../src/utilities/omath.h:291:20: note: candidate: ‘long double olb::util::sin(long double)’
    291 | inline long double sin(long double arg)
    | ^~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:2983:19: error: call of overloaded ‘floor(double&)’ is ambiguous
    2983 | if (a == floor(a)) {
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:165:15: note: candidate: ‘double floor(double)’
    165 | __MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
    | ^~~~~
    /usr/include/c++/9/cmath:264:23: note: candidate: ‘constexpr long double std::floor(long double)’
    264 | floor(long double __x)
    | ^~
    /usr/include/c++/9/cmath:260:17: note: candidate: ‘constexpr float std::floor(float)’
    260 | floor(float __x)
    | ^~
    ../../../src/utilities/omath.h:694:14: note: candidate: ‘float olb::util::floor(float)’
    694 | inline float floor(float arg)
    | ^~~~~
    ../../../src/utilities/omath.h:699:15: note: candidate: ‘double olb::util::floor(double)’
    699 | inline double floor(double arg)
    | ^~~~~
    ../../../src/utilities/omath.h:704:20: note: candidate: ‘long double olb::util::floor(long double)’
    704 | inline long double floor(long double arg)
    | ^~~~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:2987:28: error: call of overloaded ‘round(double&)’ is ambiguous
    2987 | double rtwoa = round(twoa);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:298:15: note: candidate: ‘double round(double)’
    298 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
    | ^~~~~
    /usr/include/c++/9/cmath:1760:23: note: candidate: ‘constexpr long double std::round(long double)’
    1760 | round(long double __x)
    | ^~
    /usr/include/c++/9/cmath:1756:17: note: candidate: ‘constexpr float std::round(float)’
    1756 | round(float __x)
    | ^~
    ../../../src/utilities/omath.h:796:14: note: candidate: ‘float olb::util::round(float)’
    796 | inline float round(float arg)
    | ^~~~~
    ../../../src/utilities/omath.h:801:15: note: candidate: ‘double olb::util::round(double)’
    801 | inline double round(double arg)
    | ^~~~~
    ../../../src/utilities/omath.h:806:20: note: candidate: ‘long double olb::util::round(long double)’
    806 | inline long double round(long double arg)
    | ^~~~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:2993:15: error: call of overloaded ‘cos(double&)’ is ambiguous
    2993 | a = cos (a);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:62:15: note: candidate: ‘double cos(double)’
    62 | __MATHCALL_VEC (cos,, (_Mdouble_ __x));
    | ^~~
    /usr/include/c++/9/cmath:188:23: note: candidate: ‘constexpr long double std::cos(long double)’
    188 | cos(long double __x)
    | ^
    /usr/include/c++/9/cmath:184:17: note: candidate: ‘constexpr float std::cos(float)’
    184 | cos(float __x)
    | ^
    ../../../src/utilities/omath.h:340:14: note: candidate: ‘float olb::util::cos(float)’
    340 | inline float cos(float arg)
    | ^~~
    ../../../src/utilities/omath.h:350:15: note: candidate: ‘double olb::util::cos(double)’
    350 | inline double cos(double arg)
    | ^~~
    ../../../src/utilities/omath.h:355:20: note: candidate: ‘long double olb::util::cos(long double)’
    355 | inline long double cos(long double arg)
    | ^~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:2995:15: error: call of overloaded ‘sin(double&)’ is ambiguous
    2995 | a = sin (a);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:64:15: note: candidate: ‘double sin(double)’
    64 | __MATHCALL_VEC (sin,, (_Mdouble_ __x));
    | ^~~
    /usr/include/c++/9/cmath:429:23: note: candidate: ‘constexpr long double std::sin(long double)’
    429 | sin(long double __x)
    | ^
    /usr/include/c++/9/cmath:425:17: note: candidate: ‘constexpr float std::sin(float)’
    425 | sin(float __x)
    | ^
    ../../../src/utilities/omath.h:276:14: note: candidate: ‘float olb::util::sin(float)’
    276 | inline float sin(float arg)
    | ^~~
    ../../../src/utilities/omath.h:286:15: note: candidate: ‘double olb::util::sin(double)’
    286 | inline double sin(double arg)
    | ^~~
    ../../../src/utilities/omath.h:291:20: note: candidate: ‘long double olb::util::sin(long double)’
    291 | inline long double sin(long double arg)
    | ^~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp: In function ‘double cospi(double)’:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:3011:18: error: call of overloaded ‘cos(double&)’ is ambiguous
    3011 | return cos (a);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:62:15: note: candidate: ‘double cos(double)’
    62 | __MATHCALL_VEC (cos,, (_Mdouble_ __x));
    | ^~~
    /usr/include/c++/9/cmath:188:23: note: candidate: ‘constexpr long double std::cos(long double)’
    188 | cos(long double __x)
    | ^
    /usr/include/c++/9/cmath:184:17: note: candidate: ‘constexpr float std::cos(float)’
    184 | cos(float __x)
    | ^
    ../../../src/utilities/omath.h:340:14: note: candidate: ‘float olb::util::cos(float)’
    340 | inline float cos(float arg)
    | ^~~
    ../../../src/utilities/omath.h:350:15: note: candidate: ‘double olb::util::cos(double)’
    350 | inline double cos(double arg)
    | ^~~
    ../../../src/utilities/omath.h:355:20: note: candidate: ‘long double olb::util::cos(long double)’
    355 | inline long double cos(long double arg)
    | ^~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:3017:28: error: call of overloaded ‘round(double&)’ is ambiguous
    3017 | double rtwoa = round(twoa);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:298:15: note: candidate: ‘double round(double)’
    298 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
    | ^~~~~
    /usr/include/c++/9/cmath:1760:23: note: candidate: ‘constexpr long double std::round(long double)’
    1760 | round(long double __x)
    | ^~
    /usr/include/c++/9/cmath:1756:17: note: candidate: ‘constexpr float std::round(float)’
    1756 | round(float __x)
    | ^~
    ../../../src/utilities/omath.h:796:14: note: candidate: ‘float olb::util::round(float)’
    796 | inline float round(float arg)
    | ^~~~~
    ../../../src/utilities/omath.h:801:15: note: candidate: ‘double olb::util::round(double)’
    801 | inline double round(double arg)
    | ^~~~~
    ../../../src/utilities/omath.h:806:20: note: candidate: ‘long double olb::util::round(long double)’
    806 | inline long double round(long double arg)
    | ^~~~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:3024:15: error: call of overloaded ‘cos(double&)’ is ambiguous
    3024 | a = cos (a);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:62:15: note: candidate: ‘double cos(double)’
    62 | __MATHCALL_VEC (cos,, (_Mdouble_ __x));
    | ^~~
    /usr/include/c++/9/cmath:188:23: note: candidate: ‘constexpr long double std::cos(long double)’
    188 | cos(long double __x)
    | ^
    /usr/include/c++/9/cmath:184:17: note: candidate: ‘constexpr float std::cos(float)’
    184 | cos(float __x)
    | ^
    ../../../src/utilities/omath.h:340:14: note: candidate: ‘float olb::util::cos(float)’
    340 | inline float cos(float arg)
    | ^~~
    ../../../src/utilities/omath.h:350:15: note: candidate: ‘double olb::util::cos(double)’
    350 | inline double cos(double arg)
    | ^~~
    ../../../src/utilities/omath.h:355:20: note: candidate: ‘long double olb::util::cos(long double)’
    355 | inline long double cos(long double arg)
    | ^~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:3026:15: error: call of overloaded ‘sin(double&)’ is ambiguous
    3026 | a = sin (a);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:64:15: note: candidate: ‘double sin(double)’
    64 | __MATHCALL_VEC (sin,, (_Mdouble_ __x));
    | ^~~
    /usr/include/c++/9/cmath:429:23: note: candidate: ‘constexpr long double std::sin(long double)’
    429 | sin(long double __x)
    | ^
    /usr/include/c++/9/cmath:425:17: note: candidate: ‘constexpr float std::sin(float)’
    425 | sin(float __x)
    | ^
    ../../../src/utilities/omath.h:276:14: note: candidate: ‘float olb::util::sin(float)’
    276 | inline float sin(float arg)
    | ^~~
    ../../../src/utilities/omath.h:286:15: note: candidate: ‘double olb::util::sin(double)’
    286 | inline double sin(double arg)
    | ^~~
    ../../../src/utilities/omath.h:291:20: note: candidate: ‘long double olb::util::sin(long double)’
    291 | inline long double sin(long double arg)
    | ^~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp: In function ‘double erfinv(double)’:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:3060:18: error: call of overloaded ‘log1p(double)’ is ambiguous
    3060 | t = log1p(-fa);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:122:15: note: candidate: ‘double log1p(double)’
    122 | __MATHCALL (log1p,, (_Mdouble_ __x));
    | ^~~~~
    /usr/include/c++/9/cmath:1555:23: note: candidate: ‘constexpr long double std::log1p(long double)’
    1555 | log1p(long double __x)
    | ^~
    /usr/include/c++/9/cmath:1551:17: note: candidate: ‘constexpr float std::log1p(float)’
    1551 | log1p(float __x)
    | ^~
    ../../../src/utilities/omath.h:221:14: note: candidate: ‘float olb::util::log1p(float)’
    221 | inline float log1p(float arg)
    | ^~~~~
    ../../../src/utilities/omath.h:231:15: note: candidate: ‘double olb::util::log1p(double)’
    231 | inline double log1p(double arg)
    | ^~~~~
    ../../../src/utilities/omath.h:236:20: note: candidate: ‘long double olb::util::log1p(long double)’
    236 | inline long double log1p(long double arg)
    | ^~~~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp: In function ‘double erfcinv(double)’:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:3160:14: error: call of overloaded ‘log(const double&)’ is ambiguous
    3160 | t = log(a);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:104:15: note: candidate: ‘double log(double)’
    104 | __MATHCALL_VEC (log,, (_Mdouble_ __x));
    | ^~~
    /usr/include/c++/9/cmath:342:23: note: candidate: ‘constexpr long double std::log(long double)’
    342 | log(long double __x)
    | ^
    /usr/include/c++/9/cmath:338:17: note: candidate: ‘constexpr float std::log(float)’
    338 | log(float __x)
    | ^
    ../../../src/utilities/omath.h:125:14: note: candidate: ‘float olb::util::log(float)’
    125 | inline float log(float arg)
    | ^~~
    ../../../src/utilities/omath.h:135:15: note: candidate: ‘double olb::util::log(double)’
    135 | inline double log(double arg)
    | ^~~
    ../../../src/utilities/omath.h:140:20: note: candidate: ‘long double olb::util::log(long double)’
    140 | inline long double log(long double arg)
    | ^~~
    In file included from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.h:12187,
    from /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/common_functions.h:303,
    from /usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_runtime.h:267,
    from /tmp/tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:9,
    from tmpxft_00001919_00000000-6_channel3d.cudafe1.stub.c:one:
    /usr/local/cuda-12.1/targets/x86_64-linux/include/crt/math_functions.hpp:3191:14: error: call of overloaded ‘log(const double&)’ is ambiguous
    3191 | t = log(a);
    | ^
    /usr/include/x86_64-linux-gnu/bits/mathcalls.h:104:15: note: candidate: ‘double log(double)’
    104 | __MATHCALL_VEC (log,, (_Mdouble_ __x));
    | ^~~
    /usr/include/c++/9/cmath:342:23: note: candidate: ‘constexpr long double std::log(long double)’
    342 | log(long double __x)
    | ^
    /usr/include/c++/9/cmath:338:17: note: candidate: ‘constexpr float std::log(float)’
    338 | log(float __x)
    | ^
    ../../../src/utilities/omath.h:125:14: note: candidate: ‘float olb::util::log(float)’
    125 | inline float log(float arg)
    | ^~~
    ../../../src/utilities/omath.h:135:15: note: candidate: ‘double olb::util::log(double)’
    135 | inline double log(double arg)
    | ^~~
    ../../../src/utilities/omath.h:140:20: note: candidate: ‘long double olb::util::log(long double)’
    140 | inline long double log(long double arg)
    | ^~~
    make: *** [../../../default.single.mk:35: channel3d.o] Error 1

    `

    Thank you.

    #8002
    Adrian
    Keymaster

    These overload conflicts when using nvcc are caused due to the using namespace olb::utils; at the top of the case (which should no actually be an issue in this context but is bad style anyway). For more details you can read this thread.

    However this won’t get turbulence/channel3d running on GPUs as it is not included in the GPU-enabled examples for release 1.6 (you can compare the release notes for a full list). The reason for this is the usage of a old implementation of a wall function that was written way before the GPU port without a focus on performance. Better versions are being worked on internally but are not yet included in the release.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.