|
26 | 26 | % endif |
27 | 27 | % endif |
28 | 28 |
|
29 | | -# NVHPC and CUDA env vars |
30 | | -export NV_ACC_USE_MALLOC=0 # use cudaMallocManaged instead of malloc ( compiled using -gpu=mem:unified:managedalloc ) |
31 | | -export NVCOMPILER_ACC_NO_MEMHINTS=1 # disable implicit compiler hints |
32 | | -#export CUDA_BUFFER_PAGE_IN_THRESHOLD_MS=0.001 # workaround for copying to/from unpopulated buffers on GH |
| 29 | +# We compiled the code using -gpu=unified:managedalloc, hence we use cudaMallocManaged for the dynamic allocations. |
| 30 | +# Using NV_ACC_USE_MALLOC we could change to malloc at runtime. We choose to not do that here and stick with cudaMallocManaged and 2MB page sizes. |
| 31 | +# https://docs.nvidia.com/hpc-sdk/compilers/hpc-compilers-user-guide/index.html#memory-model |
| 32 | +# https://docs.nvidia.com/hpc-sdk/compilers/hpc-compilers-user-guide/index.html#command-line-options-selecting-compiler-memory-modes |
| 33 | +export NV_ACC_USE_MALLOC=0 |
| 34 | + |
| 35 | +# For NVIDIA CUDA devices, controls the use of automatic memory hints at data constructs in the managed and unified memory modes. |
| 36 | +# Below is a breakdown of the permitted values (case insensitive): |
| 37 | +# - DEFAULT: Use the default settings. On NVIDIA Grace Hopper systems, the default is currently ENABLE_ALL; on all other systems, the default is DISABLE. |
| 38 | +# - DISABLE: Memory hints are disabled for all data constructs. |
| 39 | +# - ENABLE_EXPLICIT: Memory hints are enabled for explicit data constructs only. |
| 40 | +# - ENABLE_ALL: Memory hints are enabled for explicit and implicit data constructs. |
| 41 | +# https://docs.nvidia.com/hpc-sdk/compilers/hpc-compilers-user-guide/index.html#environment-variables-controlling-device-memory-management |
| 42 | +# Here we disable the implicit compiler hints. |
| 43 | +# Using NVCOMPILER_ACC_NO_MEMHINTS is the legacy way and is still supported, but users should prefer NVCOMPILER_ACC_MEMHINTS when using newer nvhpc compilers. |
| 44 | +export NVCOMPILER_ACC_NO_MEMHINTS=1 # disable implicit compiler hints - legacy way |
| 45 | +export NVCOMPILER_ACC_MEMHINTS=DISABLE # disable implicit compiler hints - new way |
33 | 46 |
|
34 | 47 | # Cray MPICH |
35 | 48 | export MPICH_GPU_SUPPORT_ENABLED=1 |
|
0 commit comments