I think this is caused by this code:

  
      github.com
  
  
    pytorch/pytorch/blob/v1.3.1/torch/utils/cpp_extension.py#L26 4

from .file_baton import FileBaton
from ._cpp_extension_versioner import ExtensionVersioner


from setuptools.command.build_ext import build_ext




IS_WINDOWS = sys.platform == 'win32'


BUILD_NAMEDTENSOR = os.getenv('BUILD_NAMEDTENSOR', '').upper() == '1'


def _find_cuda_home():
    '''Finds the CUDA install path.'''
    # Guess #1
    cuda_home = os.environ.get('CUDA_HOME') or os.environ.get('CUDA_PATH')
    if cuda_home is None:
        # Guess #2
        try:
            which = 'where' if IS_WINDOWS else 'which'
            nvcc = subprocess.check_output(
                [which, 'nvcc']).decode().rstrip('\r\n')
            cuda_home = os.path.dirname(os.path.dirname(nvcc))



  
  
    
    
  
  


that’s executed unconditionally when building extensions.
If it’s not causing an actual failure and is just alarming, you might be able to shut it up by setting CUDA_HOME or CUDA_PATH in the env even without CUDA installed.