Repository: pytorch
Issue: Libtorch:  nvrtc: error: invalid value for --gpu-architecture (-arch)
Labels: triaged

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->
Libtorch:
When I tried to put multi-images into model through a loop function, this error occured. Does anyone know how to fix it?
## Details

When I put just 1 image->tensor to model, it goes normally.
But when I put the procedure in a loop func,things go wrong.
<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Code
This is my code:
```
while (true) {
		cap.read(img);
		pyrDown(img, img, Size(img.cols / 2, img.rows / 2));
		cv::Scalar value = cv::Scalar(0, 0, 0);
		copyMakeBorder(img, img, 2, 2, 0, 0, BORDER_CONSTANT, value);
		cvtColor(img, img, CV_BGR2RGB);
		torch::Tensor tensor_image = torch::from_blob(img.data, { 1, img.rows, img.cols, 3 }, torch::kByte); 
		tensor_image = tensor_image.permute({ 0, 3, 1, 2 }); 
		tensor_image = tensor_image.toType(torch::kFloat);
		tensor_image = tensor_image.div(255.0); 
		tensor_image[0][0] = tensor_image[0][0].sub_(0.5).div_(0.5);
		tensor_image[0][1] = tensor_image[0][1].sub_(0.5).div_(0.5);
		tensor_image[0][2] = tensor_image[0][2].sub_(0.5).div_(0.5);
		tensor_image = tensor_image.to(torch::kCUDA);
		//inputs：torch.Size([1, 3, 544, 960])
		try
		{
			torch::Tensor output = module.forward({ tensor_image }).toTensor();

		}
		catch (const std::exception& e)
		{
			cerr << e.what();
			system("pause");
			return 0;
		}
}
```
<!-- A clear and concise description of what you expected to happen. -->

This is the err message:
```
nvrtc: error: invalid value for --gpu-architecture (-arch)

nvrtc compilation failed:

#define NAN __int_as_float(0x7fffffff)
#define POS_INFINITY __int_as_float(0x7f800000)
#define NEG_INFINITY __int_as_float(0xff800000)


template<typename T>
__device__ T maximum(T a, T b) {
  return isnan(a) ? a : (a > b ? a : b);
}

template<typename T>
__device__ T minimum(T a, T b) {
  return isnan(a) ? a : (a < b ? a : b);
}

extern "C" __global__
void func_1(float* t0, float* t1, float* aten_add_flat, float* aten_relu_flat, float* aten_relu_flat_1) {
{
  aten_relu_flat[512 * blockIdx.x + threadIdx.x] = (((__ldg(t0 + (61440 * (((512 * blockIdx.x + threadIdx.x) / 60) % 34) + 1024 * ((512 * blockIdx.x + threadIdx.x) % 60)) + (((512 * blockIdx.x + threadIdx.x) / 60) / 34) % 1024))<0.f ? 1 : 0) ? 0.f : __ldg(t0 + (61440 * (((512 * blockIdx.x + threadIdx.x) / 60) % 34) + 1024 * ((512 * blockIdx.x + threadIdx.x) % 60)) + (((512 * blockIdx.x + threadIdx.x) / 60) / 34) % 1024));
  aten_relu_flat_1[512 * blockIdx.x + threadIdx.x] = (((__ldg(t1 + (2040 * ((((512 * blockIdx.x + threadIdx.x) / 60) / 34) % 1024) + 60 * (((512 * blockIdx.x + threadIdx.x) / 60) % 34)) + (512 * blockIdx.x + threadIdx.x) % 60))<0.f ? 1 : 0) ? 0.f : __ldg(t1 + (2040 * ((((512 * blockIdx.x + threadIdx.x) / 60) / 34) % 1024) + 60 * (((512 * blockIdx.x + threadIdx.x) / 60) % 34)) + (512 * blockIdx.x + threadIdx.x) % 60));
  aten_add_flat[512 * blockIdx.x + threadIdx.x] = ((((__ldg(t1 + (2040 * ((((512 * blockIdx.x + threadIdx.x) / 60) / 34) % 1024) + 60 * (((512 * blockIdx.x + threadIdx.x) / 60) % 34)) + (512 * blockIdx.x + threadIdx.x) % 60))<0.f ? 1 : 0) ? 0.f : __ldg(t1 + (2040 * ((((512 * blockIdx.x + threadIdx.x) / 60) / 34) % 1024) + 60 * (((512 * blockIdx.x + threadIdx.x) / 60) % 34)) + (512 * blockIdx.x + threadIdx.x) % 60))) + ((((__ldg(t0 + (61440 * (((512 * blockIdx.x + threadIdx.x) / 60) % 34) + 1024 * ((512 * blockIdx.x + threadIdx.x) % 60)) + (((512 * blockIdx.x + threadIdx.x) / 60) / 34) % 1024))<0.f ? 1 : 0) ? 0.f : __ldg(t0 + (61440 * (((512 * blockIdx.x + threadIdx.x) / 60) % 34) + 1024 * ((512 * blockIdx.x + threadIdx.x) % 60)) + (((512 * blockIdx.x + threadIdx.x) / 60) / 34) % 1024)));
}
}
```
## Environment
rtx 3080
libtorch_deps_cu110
cuda11.0
win10+vs2017




<!-- Add any other context about the problem here. -->