Thanks very much for your answer @tom !
Just opened a ‘Feature Request’ issue in the GitHub repository.
Here’s the link for future reference:

  

      github.com/pytorch/pytorch
  

  
    
  
	  
  

  
    
      Query CUDA version LibTorch has been compiled with 1
    

    
      
        opened 
        
          
        
        Nov 12, 2021
      
      


      
        
          
          dfalbel
        
      
    

    
    
  


  
    ## 🚀 Feature

Allow runtime querying the CUDA version LibTorch has been compil…ed with.

## Motivation

We might want to use different code paths depending on the CUDA version LibTorch has been compiled with. Depending on the implementation, this can only be found at runtime.

## Pitch

We want to be able to identify the CUDA version LibTorch has been compiled with. Ideally there would be a function defined in the torch namespace that would allow one to query this information.

## Alternatives

An alternative, suggested by @t-vi in this [post](https://discuss.pytorch.org/t/query-cuda-version-at-runtime/136715/2?u=dfalbel) in the forum would be to have a macros defined in [version.h](https://github.com/pytorch/pytorch/blob/master/torch/csrc/api/include/torch/version.h.in) similar to what already happens with the Python package.

As a workaround It seems possible to identify the version by parsing the `build-version` file inside the pre-built binary package - but that doesn't seem reliable for most use cases.

## Additional context

- https://discuss.pytorch.org/t/query-cuda-version-at-runtime/136715
- https://github.com/mlverse/lltm/issues/2