So, given a running Tegra system, what’s the ideal way of determining whether a system is a Nano, TX2, Xavier, etc? I was thinking of relying on the apt sources since that now lists the SOC, however that seems rather fragile and I was wondering if there was a better way (something in /proc maybe).
hello mdegans,
there’re several ways to check it.
- you may refer to Quick Start Guide to determine whether the developer kit is in Force Recovery mode.
for example, it’s 7c18 for Jetson-TX2.
$ lsusb
Bus 001 Device 068: ID 0955:<b>7c18</b> NVidia Corp.
- you could check the nv_tegra_release for release version and also board version from the system.
for example,
$ cat /etc/nv_tegra_release
# R32 (release), REVISION: 3.1, GCID: , <b>BOARD: t186ref</b>, EABI: aarch64, DATE: Thu Dec 19 03:38:02 UTC 2019
- besides, you could also check the kernel message, please search for “DTS File Name” for Jetson Modules and SoCs.
for example, this is TX2.
$ dmesg | grep "DTS File Name"
[ 0.184289] DTS File Name: .../t18x/quill/kernel-dts/tegra186-quill-<b>p3310</b>-1000-c03-00-base.dts
Thanks, Jerry! That’s exactly what I needed.
My experience is that it depends on the release. The /etc/nv_tegra_release file was omitted for a couple of releases when a dpkg feature for lookup was introduced. I believe that /etc/nv_tegra_release was added back in recently.
For the code to be “robust” you may have to do some hunting. Raffaello Bonghi has a shell script for the heavy lifting:
https://github.com/rbonghi/jetson_stats/blob/master/scripts/jetson_variables
It can be difficult to differentiate the TX1 from the Nano from the chip ID/nv_tegra_release methods, the advantage of the DTS method is that you can determine the actual board in use. For example, this might be useful for differentiating between a Jetson Nano Rev A and a Rev B board. I’m not sure how you differentiate between a dev kit module and a production module.
Thanks, Kangalow. That give me some more options. Unfortunately “dmesg | grep DTS” doesn’t seem to work on my Nano (i guess it’s not printed anymore), and /etc/nv_tegra_release only tells me the soc.
I had a look in proc, and it looks like on Nano i get:
$ cat /proc/device-tree/nvidia,boardids
3448
(and that would also be in /sys since /proc/device-tree is a symlink there)
So I’m just putting that here as another tidbit for whoever else is looking.
There is other useful stuff in /proc/device-tree like the dts filename:
$ cat /proc/device-tree/nvidia,dtsfilename
/dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/../../../../../../hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts
also
$ cat /proc/device-tree/model
NVIDIA Jetson Nano Developer Kit
and
$ cat /proc/device-tree/compatible
nvidia,p3449-0000-b00+p3448-0000-b00nvidia,jetson-nanonvidia,tegra210
there is more, including the serial
I’m gonna make a quick python library for this and will post a link here when done.
So for those who want it, there is this python code to read various things:
# Copyright 2020 Michael de Gans
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import os
import re
__all__ = [
'name',
'model',
'compatible_models',
'dts_filename',
'soc',
'nickname',
]
def cat(filename) -> str:
with open(filename) as f:
return f.read().rstrip('\x00')
def name():
return cat('/proc/device-tree/model')
def model():
return cat('/proc/device-tree/nvidia,proc-boardid')
def compatible_models():
raw = cat('/proc/device-tree/compatible')
return re.split(r'nvidia|\x00|,|\+', raw)[2:4]
def dts_filename(short=False):
if short:
return os.path.basename(dts_filename())
return os.path.abspath(cat('/proc/device-tree/nvidia,dtsfilename'))
def soc(short=False):
if short:
return re.search(r'(?<=platform/)(.*)(?=kernel-dts)', dts_filename())[0].split('/')[0]
raw = cat('/proc/device-tree/compatible')
return re.split(r'nvidia|\x00|,|\+', raw)[9]
def nickname():
return re.search(r'(?<=platform/)(.*)(?=kernel-dts)', dts_filename())[0].split('/')[1]
def quick_test():
print(f'name={name()}')
print(f'model={model()}')
print(f'compatible_models={compatible_models()}')
print(f'dts_filename={dts_filename()}')
print(f'dts_filename_short={dts_filename(short=True)}')
print(f'soc={soc()}')
print(f'short_soc={soc(short=True)}')
print(f'nickname={nickname()}')
if __name__ == "__main__":
quick_test()
when run:
name=NVIDIA Jetson Nano Developer Kit
model=3448
compatible_models=['p3449-0000-b00', 'p3448-0000-b00']
dts_filename=/dvs/git/dirty/git-master_linux/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts
dts_filename_short=tegra210-p3448-0000-p3449-0000-b00.dts
soc=tegra210
short_soc=t210
nickname=porg
I will put it on GitHub later after I add tests. I plan on finding at least one other way to get each string so if they don’t match, the test fails. Any help would be welcome.
Hi mdegans,
I was looking this thread and there are a lot of point interesting also for my jetson-stats.
Thank you Kangalow to quote me! :-)
I use to recognize the jetson model this number: /sys/module/tegra_fuse/parameters/tegra_chip_id but don’t recognize some model
I notice that not all commands have the same output:
Nano - JP 4.3:
Xavier - JP 4.2.2:
TX2 - JP 3.2:
I can’t check a TX1 right now, I will do soon.
I think a good reference to recognize the board is use the last name in /proc/device-tree/compatible, but I’m not sure of that.
Best,
Raffaello
Thanks rbonghi,
That output is very useful. It does seem like the last part of …/compatible is the best place along with first part of the dts basename. It’s interesting that …/nvidia,boardids isn’t on every system.
I finally bring my TX1, this is the output:
TX1 - JP 3.2:
I don’t have a TK1 with me, but it’s out of production.
Anyway to recognize the Nano and the TX1 require more than one step.
Best,
Raffaello