I’m not sure how you’ve checked the gradient in the first layer, but running your code for a single step I get:
print((model[0].weight.grad))
> tensor([[0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          ...,
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.]])

While this looks like an all-zero gradient, note that the output is truncated.
Visualizing an example gradient of the first layer via:
f, axarr = plt.subplots(1, 2)
axarr[0].imshow(model[0].weight.grad[0].view(28, 28))
axarr[1].imshow(model[0].weight.grad[0].view(28, 28) == 0)

gives:

So I would assume that the raw inputs containing zeros (the borders of the MNIST images) are creating the zero gradient.