Is installed CUDA capable graphics card necessary (in Linux) for compiling CUDA programs with nvcc? Or one can compile programs everywhere and run only on such
nvcc
No, a graphics card is not necessary for compilation.
You don't even need one to run the program; you can have it emulated in software.
UPDATE Ok, apparently, SW emulation hasn't been supported since CUDA 3.0.