gpu usage question
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › gpu usage question
- This topic has 28 replies, 4 voices, and was last updated 9 months, 2 weeks ago by toson.
-
AuthorPosts
-
March 3, 2023 at 6:01 am #7255H.YuParticipant
Hi
Thank you for alwaysTo use gpu, change gpu_open_mpi in config folder to config.mk 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?March 3, 2023 at 9:39 am #7256AdrianKeymasterCUDA 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 ofsrc/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 inconfig/gpu_openmpi.mk
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 config.mk and the outputs ofmpicxx --showme:compile
andmpicxx --showme:link
. (You can also try the non-MPI configconfig/gpu_only.mk
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.March 3, 2023 at 10:43 am #7257H.YuParticipantThank 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 -lmpisecond :
” nvcc -V ” results : Cuda compilation tools, release 10.1, V10.1.243third :
” nvidia-smi ” results : CUDA Version: 12.0fourth :
” #include <thrust/execution_policy.h> ” addfifth :
” gpu_only.mk ” result : same error “value c++17 is not defined for std..”sixth :
The file name in the config folder was changed to config.mk and used.
code
“””
CXX := nvcc
CC := nvccCXXFLAGS := -O3
CXXFLAGS += -std=c++17PARALLEL_MODE := MPI
MPIFLAGS := -lmpi_cxx -lmpi
PLATFORMS := CPU_SISD GPU_CUDA
# for e.g. RTX 30* (Ampere), see table in
rules.mk
for other options
CUDA_ARCH := 86USE_EMBEDDED_DEPENDENCIES := ON
“””thank you!
March 3, 2023 at 12:23 pm #7258AdrianKeymasterOk, 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 theconfig/gpu_only.mk
should work and we can continue to get MPI support working on your end (assuming you have more than one GPU in the system).March 6, 2023 at 3:38 am #7261H.YuParticipantthank you!
I was suspicious about the different cuda versions of nvcc and nvidia-smi.
I was able to understand and solve this problem. thank youMarch 6, 2023 at 8:37 am #7262H.YuParticipantI 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
a=sin(a);
I get tons of ‘error : call of overloaded’March 6, 2023 at 12:20 pm #7267AdrianKeymasterWhich 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.March 6, 2023 at 12:43 pm #7268H.YuParticipantwhat is mean ‘case’ ?
i’m using cylinder3D example and gpu_openmpi.mkMarch 6, 2023 at 12:49 pm #7269AdrianKeymasterYes, 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?
March 6, 2023 at 12:58 pm #7270H.YuParticipantyes i tring to gpu_only.mk
but same error to occurMarch 6, 2023 at 3:58 pm #7271AdrianKeymasterOk, I just tried to compile using CUDA 11.3 and the same
config/gpu_only.mk
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 ofnvcc --version
? Does the compilation also fail for other examples?March 7, 2023 at 5:55 am #7277H.YuParticipantThe 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’
error:
‘/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’March 7, 2023 at 10:50 am #7280AdrianKeymasterSorry 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).
March 7, 2023 at 11:10 am #7282H.YuParticipantYes 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.
March 7, 2023 at 11:14 am #7283H.YuParticipanterror : 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?
-
AuthorPosts
- You must be logged in to reply to this topic.