You can use vcgencmd to get the memory:
pi@raspberrypi:~$ vcgencmd get_mem gpu
Alternatively use raspi-config non-interactively, which uses vcgencmd underneath and pulls out just the number:
pi@raspberrypi:~$ sudo raspi-config nonint get_config_var gpu_mem /boot/config.txt
"In normal circumstances there is NEVER a need to run rpi-update as it always gets you to the leading edge firmware and kernel and because that may be a testing version it could leave your RPi unbootable". https://www.raspberrypi.org/forums/viewtopic.php?p=916911#p916911
Even the rpi-update documentation now warns "Even on Raspbian you should only use this ...