Can I specify the cuda device index in the program?

Or I have to specify in the command line?

I think using the standard way will just work: export CUDA_VISIBLE_DEVICES=XXXX.
Are you switching to Linux?

Not yet. I am just preparing for the future :relieved:. However, I am still looking forward to using CUDA version of taichi on win10.

I see. I believe CUDA support on Windows will be available soon after the SIGGRAPH deadline.