more detail: please check https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars default config to LAZY, which means cuda module will be loaded when needed to save cu memory by load fatbin elf section please do not call any cuda api before this function
()
| 6 | |
| 7 | |
| 8 | def config_env(): |
| 9 | """ |
| 10 | more detail: please check https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars |
| 11 | default config to LAZY, which means cuda module will be loaded when needed to save cu memory by load fatbin elf section |
| 12 | please do not call any cuda api before this function |
| 13 | """ |
| 14 | if not os.getenv("ALREADY_CONFIG_CUDA_LOADING_MODE", False): |
| 15 | may_user_config = os.getenv("CUDA_MODULE_LOADING", "LAZY") |
| 16 | os.environ["CUDA_MODULE_LOADING"] = may_user_config |
| 17 | |
| 18 | |
| 19 | def check_pip_env(): |