Warning: Unable to detect CUDA version, default to "-arch=sm_20" instead

I met this warning message when compile to cuda target using a cpu host instance, while there is no warning if I compile with a gpu host instance. Does this message matter?

/tvm/src/target/target_kind.cc:163: Warning: Unable to detect CUDA version, default to "-arch=sm_20" instead

The target I’m using

target = "cuda -arch=sm_72"
target_host = "llvm -mtriple=x86_64-linux-gnu"
target = tvm.target.Target(target=target, host=target_host)
des_exec = relay.vm.compile(mod, target=target, params=params)

I think it’s a bug which does not actually impact the compilation. Can you please post your script for reproducing the issue and debugging?

@zxybazh sure, thanks for the reply.

import torch
import torchvision
import tvm
from tvm import relay

input_shape = [1, 3, 224, 224]
input_data = torch.randn(input_shape)

model_name = "resnet152"
model = getattr(torchvision.models, model_name)(pretrained=True)
model = model.eval()
scripted_model = torch.jit.trace(model, input_data).eval()

mod, params = relay.frontend.from_pytorch(scripted_model, [('data', [1,3,224,224])])
target = "cuda -arch=sm_72"
target_host = "llvm -mtriple=x86_64-linux-gnu"
target = tvm.target.Target(target=target, host=target_host)
des_exec = relay.vm.compile(mod, target=target, params=params)
1 Like