After I got the filtered vcf file of snps with gatk pipeline, I tried to run PCA with gcta.
afterwords, I tried to find the explained variation percentage for each PCs(principal components).
what I'm confused is that the eigenvalue results I get are always the same number as the sample size.
I thought that the amount of possible PCs were the same as the variable dimension I have (which is the number of snps called, about 17000000 in this case) and there should be the same amount of eigenvalues related to it. Of course there could be same eigenvalues and PCs that explain small variation are useless, but isn't it possible that there could be 17000000 PCs and eigenvalues? So I thought when I want to get the explained variation percentage of PC1, I had to divide it by the some of 17000000 eigenvalues. could someone explain why this is wrong and why I always get the same number of eigenvalues as the sample size?

The principal components are the eigenvectors of the covariance matrix (or correlation, if you scale) of your data.  Now, you have two choices: do you want to focus on the covariance between your N samples, or the covariance between your M SNPs?  GCTA focuses on the former, whereas you thought it was the latter.  GCTA's covariance matrix (aka GRM) is NxN, hence you will get N eigenvectors. You are not reducing the "SNP dimensions", you are reducing the "sample dimensions". 
