I want to know what libtorch API that we can use to get the CUDA and CuDNN version?
Ps:
Right now I have a project that using both opencv DNN and Libtorch, but I keep getting warning because unmatch cudnn version. I use pre-built libtorch library.
#include <torch/torch.h>
#include <ATen/cuda/CUDAContext.h>
using namespace std;
void print_LibtorchVersion() {
cout << "PyTorch version: "
<< TORCH_VERSION_MAJOR << "."
<< TORCH_VERSION_MINOR << "."
<< TORCH_VERSION_PATCH << endl;
}
void print_CUDA_cuDNN_info() {
long cudnn_version = at::detail::getCUDAHooks().versionCuDNN();
cout << "The cuDNN version is " << cudnn_version <<"\n";
int runtimeVersion;
AT_CUDA_CHECK(cudaRuntimeGetVersion(&runtimeVersion));
cout << "The CUDA runtime version is " << runtimeVersion << "\n";
int version;
AT_CUDA_CHECK(cudaDriverGetVersion(&version));
cout << "The driver version is " << version << "\n";
}