Skip to content

gpu usage question

Viewing 15 posts - 1 through 15 (of 29 total)
  • Author
  • #7255

    Thank you for always

    To use gpu, change gpu_open_mpi in config folder to and ‘make clean; make’ When I run make , it proceeds normally.

    Then, when I move to the example folder and use ‘make’ and try to do ./cylinder3d, ‘Value ‘c++17’ is not defined for option ‘std’ ‘ error occurs during ‘make’ and the make Can’t proceed.
    I am currently using RTX3090 and cuda version is 12.0. What are some things I can think about?


    CUDA 12 was released after OpenLB 1.5 and contains compilation breaking include changes (i.e. error: namespace "thrust" has no member "device"). While the next release will provide direct CUDA 12 support, what you can do today is to add #include <thrust/execution_policy.h> to the includes of src/core/platform/gpu/cuda/column.h.

    OpenLB has been successfully used on RTX 3090 GPUs and the default configs even already contain the correct CUDA_ARCH value. The “Value c++-17 is not defined for option std…” error you encounter is not expected, did you follow the comments in config/ to provide the OpenMPI flags for the nvcc compiler? If so this may explain the problem and I will be able to help if you post your and the outputs of mpicxx --showme:compile and mpicxx --showme:link. (You can also try the non-MPI config config/ for comparison).

    If you only copied the unmodifed config I will need more details on your system and CUDA setup as -std=... is the flag used to set the C++ standard version and nobody has reported your particular error before. I also just re-confirmed that this example compiles with CUDA 12.0 on our cluster.


    Thank you !
    I’m using 3090Ti
    first :
    ” mpicxx –showme:link ” results : -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,–enable-new-dtags -L/usr/local/lib -lmpi

    second :
    ” nvcc -V ” results : Cuda compilation tools, release 10.1, V10.1.243

    third :
    ” nvidia-smi ” results : CUDA Version: 12.0

    fourth :
    ” #include <thrust/execution_policy.h> ” add

    fifth :
    ” ” result : same error “value c++17 is not defined for std..”

    sixth :
    The file name in the config folder was changed to and used.
    CXX := nvcc
    CC := nvcc

    CXXFLAGS := -O3
    CXXFLAGS += -std=c++17


    MPIFLAGS := -lmpi_cxx -lmpi


    # for e.g. RTX 30* (Ampere), see table in for other options
    CUDA_ARCH := 86


    thank you!


    Ok, so you actually currently use CUDA 10.1 which seemingly doesn’t support the -std... flags. I would suggest to update to 11.* or later. After this the config/ should work and we can continue to get MPI support working on your end (assuming you have more than one GPU in the system).


    thank you!
    I was suspicious about the different cuda versions of nvcc and nvidia-smi.
    I was able to understand and solve this problem. thank you


    I have additional questions
    I don’t know if it’s a problem with OpenLB
    But, I when I use gpu Some errors occur when I do ‘make’ what is this case?

    In file included from /usr/local /cuda- 11.3 … math_function.h

    Error: call of overloaded – sin ( double & ) is ambiguous
    I get tons of ‘error : call of overloaded’


    Which case are you using? I have seen these kinds of errors before when there was a using namespace std; in the mix, such namespace leakage always causes issues.


    what is mean ‘case’ ?
    i’m using cylinder3D example and


    Yes, that is what I meant. I don’t get this error on our systems, did you already adapt the config to your OpenMPI setup (this could be one issue). Does it also occur for the basic GPU only config?


    yes i tring to
    but same error to occur


    Ok, I just tried to compile using CUDA 11.3 and the same config/ without being able to reproduce the error. Can you provide more details on your environment? How did you install CUDA and what is the exact output of nvcc --version? Does the compilation also fail for other examples?


    The 403 error keeps popping up, so the response is delayed.
    I checked that some of them work, but when I try to attach the error contents, I get a 403 error.

    nvcc version – 11.3

    i tring to ‘make’

    ‘/stlReader.h(214): warning #611-D: overloaded virtual function “olb::IndicatorF3D<S>::distance [with S=double]” is only partially overridden in class “olb::STLreader<T>”
    detected during instantiation of class “olb::STLreader<T> [with T=T]”
    naca4412_turb.cpp(74): here’

    ‘superLatticeRefinementMetricF3D.h(72): warning #997-D: overloaded function “olb::GenericF<T, S>::operator() [with T=T, S=int]” is hidden by “olb::SuperLatticeRefinementMetricKnudsen3D<T, DESCRIPTOR>::operator() [with T=T, DESCRIPTOR=DESCRIPTOR]” — virtual function override intended? ‘

    ‘detected during instantiation of class “olb::SuperLatticeRefinementMetricKnudsen3D<T, DESCRIPTOR> [with T=T, DESCRIPTOR=DESCRIPTOR]”
    naca4412_turb.cpp(230): here’

    • This reply was modified 1 year, 4 months ago by H.Yu.
    • This reply was modified 1 year, 4 months ago by H.Yu.

    Sorry about that, I’ll see if I can mark you as trusted in the forum.

    These warnings I also get, they are of course not good and are fixed if we have the time but also don’t prevent the code from working (these particular ones are also not GPU-specific).
    Are the original messages “Error: call of overloaded – sin ( double & ) is ambiguous” also “just” warnings and the program compiles or does it fail completely when targeting the GPU? Somehow your setup seems to use different math functions that interfere with our internal overloads to support the automatic differentiation subsystem. (If it compiles it is likely not a concern as these particular angular functions are not used for any of the LB models)

    Most of the warnings we get in this context are caused by the same code being used both for CPU and GPU targets, confusing the compiler (i.e. the __host__ __device__ called from __host__ warnings, hidden by the default flags).


    Yes this is not just a warning.
    Compilation is not completed due to this error. Also, the problem only occurs when using the GPU.

    In addition, I showed ‘sin ( double & ) is ambiguous’ as an example, but it displays a lot of errors besides that content.

    One curious thing is that the problem that occurs in the 74th line and the 230th line mentioned above works normally when proceeding with the example with the same content.


    error : call of overloaded log, log1p, exp, sin, cos, round …etc..

    This is a problem that occurs in several functions in the cuda folder when compiling. Do I need to reinstall CUDA?

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