Yarn maker Unifi Inc has reported its first quarterly loss in over two years after high raw material prices and weak demand overshadowed higher sales.