Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvlink warning caused by recursion in RandomGamma #101

Open
stevenhofmeyr opened this issue Feb 5, 2025 · 2 comments
Open

nvlink warning caused by recursion in RandomGamma #101

stevenhofmeyr opened this issue Feb 5, 2025 · 2 comments

Comments

@stevenhofmeyr
Copy link
Collaborator

On my laptop (nvidia CUDA compiler release 12.4, V12.4.131), I get the following warnings at link time when building the CUDA version:

nvlink warning : Stack size for entry function '_ZN5amrex13launch_globalILi256EZNS_14ParallelForRNGIiZNK13DiseaseStatusI14AgentContainerNS_12ParticleTileINS_8ParticleILi0ELi0EEELi0ELi20ENS_14ArenaAllocatorEEENS_16ParticleTileDataIS6_Li0ELi20EEES6_E12updateAgentsERS3_RSt6vectorISt10unique_ptrINS_8MultiFabESt14default_deleteISF_EESaISI_EEEUliRKNS_12RandomEngineEE_vEENSt9enable_ifIXsr5amrex19MaybeDeviceRunnableIT0_vEE5valueEvE4typeET_RKSR_EUlvE_EEvSR_' cannot be statically determined
nvlink warning : Stack size for entry function '_ZN5amrex13launch_globalILi256EZNS_14ParallelForRNGIiZN14AgentContainer12infectAgentsEvEUliRKNS_12RandomEngineEE_vEENSt9enable_ifIXsr5amrex19MaybeDeviceRunnableIT0_vEE5valueEvE4typeET_RKS8_EUlvE_EEvS8_' cannot be statically determined
nvlink warning : Stack size for entry function '_ZN5amrex13launch_globalILi256EZNS_14ParallelForRNGIiZN13HospitalModelI14AgentContainerNS_16ParticleTileDataINS_8ParticleILi0ELi0EEELi0ELi20EEES6_E11treatAgentsERS3_RSt6vectorISt10unique_ptrINS_8MultiFabESt14default_deleteISC_EESaISF_EEEUliRKNS_12RandomEngineEE_vEENSt9enable_ifIXsr5amrex19MaybeDeviceRunnableIT0_vEE5valueEvE4typeET_RKSO_EUlvE_EEvSO_' cannot be statically determined
nvlink warning : Stack size for entry function '_ZN5amrex13launch_globalILi256EZNS_14ParallelForRNGIZN63_INTERNAL_8f05c69d_24_InitializeInfections_cpp_aaef0290_316053423infect_random_communityER14AgentContainerRKNS_6VectorIiSaIiEEERNS_9iMultiFabERSt3mapISt4pairIiiENS_9DenseBinsINS_8ParticleILi0ELi0EEEEESt4lessISE_ESaISD_IKSE_SI_EEEiiibEUliiiRKNS_12RandomEngineEE_Li2EEENSt9enable_ifIXsr5amrex19MaybeDeviceRunnableIT_vEE5valueEvE4typeERKNS_5BoxNDIXT0_EEERKSV_EUlvE_EEvT0_' cannot be statically determined

Turns out these warnings are generated by recursion in CUDA code and are not necessarily a problem. They are generated by the new RandomGamma function which uses recursion. Need to either implement that without recursion or suppress this warning (with the knowledge that the recursion can never cause stack overflow).

@atmyers
Copy link
Contributor

atmyers commented Feb 5, 2025

I think I can fix this by adding an extra template parameter to make the function non-recursive.

@atmyers
Copy link
Contributor

atmyers commented Feb 5, 2025

AMReX-Codes/amrex#4324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants