I’ve been trying to get the C++ frontend set up in visual studio on my machine. I installed the cuda 11.1 compatible version of libtorch, but in my project the is_available command returns 0. below my code I have included the output of the collect-env.py script. Running other commands like torch::eye() works, so I’m not sure why it says PyTorch version N/A or that cuda isn’t available when I’ve installed cuda 11.1.
#include <torch/torch.h>
#include <iostream>

#include <opencv2/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

using namespace torch;

struct Net : torch::nn::Module {
    Net( int kNoiseSize)
        : conv1(torch::nn::ConvTranspose2dOptions(kNoiseSize, 256, 4)
            .bias(false)), batch_norm1(1) {
        register_module("conv1", conv1);
        register_module("batch_norm1", batch_norm1);
    }
    torch::Tensor forward(torch::Tensor input) {
        input = conv1(input);
        input = batch_norm1(input);
        return torch::relu(input).clone();
    }
    torch::nn::ConvTranspose2d conv1;
    torch::nn::BatchNorm2d batch_norm1;

};


int main() {
    std::cout << torch::cuda::is_available() << std::endl;

}

Collecting environment information…
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A
OS: Microsoft Windows 10 Enterprise
GCC version: Could not collect
Clang version: Could not collect
CMake version: version 3.21.0-rc1
Libc version: N/A
Python version: 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.18363-SP0
Is CUDA available: N/A
CUDA runtime version: 11.1.74
GPU models and configuration: GPU 0: Quadro M2000M
Nvidia driver version: 471.68
cuDNN version: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\cudnn_ops_train64_8.dll
HIP runtime version: N/A
MIOpen runtime version: N/A
Versions of relevant libraries:
[pip3] Could not collect
[conda] Could not collect