About the hypothesis that $G_k\backslash G_\mathbb A$ is compact: In addition to Will Sawin's good comments, @Aurel's example can easily be expanded a little for clarity, and some other classical-group examples given.

To fill in some details to Aurel's example: Fujisaki's lemma (as in Weil's `Adeles and algebraic groups') shows that $D^\times\backslash D_\mathbb A^1$ is compact for any (central, $n^2$-dimensional) division algebra $D$ over a global field $k$. At the same time, such $D$ splits locally almost everywhere, so the group $SL_1(D)$ is locally $SL_n(k_v)$ almost everywhere. Further, the sum of the local (Brauer-group) invariants can be any [edit: not necessarily *even*] number of fractions with denominator $n$ summing to an integer [edit: not necessarily $1$]. The local $D_v=D\otimes_k k_v$ is a division algebra (hence $SL_1(D_v)$ is compact) if and only if the least common multiple of the denominators in lowest terms is $n$. For $n$ prime, there are qualitatively only two things that can arise: $SL_n(k_v)$ and $SL_1(\mathrm{division\;algebra})$, but for $n$ composite, as in Aurel's example, it can be arranged so that no local group is compact, but the arithmetic quotient is compact.

A family of examples somewhat more distant from $GL_n$'s is the family of orthogonal groups $G=O(Q)$ of a (non-degenerate, $k$-valued) quadratic form $Q$ on a $k$-vectorspace $V$ of dimension $n$ over $k$. By Mahler's criterion from reduction theory (e.g., see Godement's treatment of reduction theory in Sem. Bourb.), if $Q$ is $k$-anisotropic, then $G_k\backslash G_\mathbb A$ is compact.

By Hasse-Minkowski, $Q$ is $k$-anisotropic if and only if it is $k_v$-anisotropic at at least one place $v$. It is straightforward that $G_v$ is compact if and only if $Q$ is $k_v$-anisotropic. For complex $k_v$, this cannot happen. For real $k_v$, there is a signature $p,q$ at $v$, and $G_v$ is compact if and only if $p=0$ or $q=0$. At finite places, in dimensions $5$ and larger, $Q$ is *always* isotropic, and $G_v$ is non-compact.