Repository: pytorch
Issue: RuntimeError: Unrecognized CachingAllocator option: expandable_segments
Labels: module: cuda,triaged

# Summary

The errors are as follows:  the code run very well previously,but it dose not work suddenly. i would appreciated if you could kindly give me some advice about it.

```Shell
use cuda & cudnn for acceleration!
the gpu id is: [2, 3]
hr npy datas have already been prepared!, hr: 800
lr npy datas have already been prepared!, lr: 800
select , set5 for evaluation! 
compile cuda source of 'pair_wise_distance' function...
NOTE: if you avoid this process, you make .cu file and compile it following https://pytorch.org/tutorials/advanced/cpp_extension.html
Traceback (most recent call last):
  File "train.py", line 51, in <module>
    model = utils.import_module('models.{}'.format(args.model)).create_model(args)
  File "/home/ziwen/SR_code/SPIN-main/utils.py", line 69, in import_module
    return importlib.import_module(name)
  File "/home/ziwen/miniconda3/envs/test/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/ziwen/SR_code/SPIN-main/models/spin.py", line 7, in <module>
    from .pair_wise_distance import PairwiseDistFunction
  File "/home/ziwen/SR_code/SPIN-main/models/pair_wise_distance.py", line 12, in <module>
    "pair_wise_distance", cpp_sources="", cuda_sources=source
  File "/home/ziwen/miniconda3/envs/test/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1445, in load_inline
    keep_intermediates=keep_intermediates)
  File "/home/ziwen/miniconda3/envs/test/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1518, in _jit_compile
    is_standalone=is_standalone)
  File "/home/ziwen/miniconda3/envs/test/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1619, in _write_ninja_file_and_build_library
    is_standalone=is_standalone)
  File "/home/ziwen/miniconda3/envs/test/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 2014, in _write_ninja_file_to_build_library
    cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags()
  File "/home/ziwen/miniconda3/envs/test/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1767, in _get_cuda_arch_flags
    capability = torch.cuda.get_device_capability(i)
  File "/home/ziwen/miniconda3/envs/test/lib/python3.7/site-packages/torch/cuda/__init__.py", line 357, in get_device_capability
    prop = get_device_properties(device)
  File "/home/ziwen/miniconda3/envs/test/lib/python3.7/site-packages/torch/cuda/__init__.py", line 371, in get_device_properties
    _lazy_init()  # will define _get_device_properties
  File "/home/ziwen/miniconda3/envs/test/lib/python3.7/site-packages/torch/cuda/__init__.py", line 229, in _lazy_init
    torch._C._cuda_init()
RuntimeError: Unrecognized CachingAllocator option: expandable_segments
```


cc @ptrblck