Read L4T version from Jetpack 4.2.1

Hi all,

I am using nv_tegra_release to read the version installed in my L4T, following https://devtalk.nvidia.com/default/topic/860092/jetson-tk1/how-do-i-know-what-version-of-l4t-my-jetson-tk1-is-running-/

/etc/nv_tegra_release

I see from Jetpack 4.2.1 this file doesn’t exist or is not in “/etc” folder. Where can I find the version from this Jetpack?

Best regards,
Raffaello

Hi Raffaello, moving forward, its recommended to read the version using dpkg from nvidia-l4t-core package.

For reference, see this script which can handle it both ways:

https://github.com/dusty-nv/jetson-inference/blob/7e81381a96c1ac5f57f1728afbfdec7f1bfeffc2/tools/install-pytorch.sh#L296

HI Dustin!

Thank you! I will use soon to update my jetson_stats!

Hi Dustin!

Thx, I fixed my file https://github.com/rbonghi/jetson_stats project

And I suggest to fix in your code with these lines. You can read all numbers JETSON_L4T_REVISION:

# Read version
JETSON_L4T_STRING=$(dpkg-query --showformat='${Version}' --show nvidia-l4t-core)
# extract version
JETSON_L4T_ARRAY=$(echo $JETSON_L4T_STRING | cut -f 1 -d '-')
# Load release and revision
JETSON_L4T_RELEASE=$(echo $JETSON_L4T_ARRAY | cut -f 1 -d '.')
JETSON_L4T_REVISION=${JETSON_L4T_ARRAY#"$JETSON_L4T_RELEASE."}