Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing/generic CPU info for the Nintendo Switch system [ARM64 | NVIDIA Tegra X1] #245

Open
WiiNewU opened this issue May 20, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@WiiNewU
Copy link

WiiNewU commented May 20, 2024

Hi, when running cpufetch on ported Ubuntu 22.04 LTS (4.9.140-l4t kernel) for the Nintendo Switch, It just provides generic ARM CPU information. I have a screenshot of cpufetch with this issue pplus neofetch underneath showing some OS/hardware info:
cpufetch and neofetch on Nintendo Switch

The Nintendo Switch uses two types of CPU depending on when its manufactured, The original 2017 release (in this case) is the standard Tegra X1 (64bit 4 core ARM CPU, might have missing e cores) with a 20 nm process. In 2019 there was an updated Tegra X1+ soc at a 16 nm process for better energy efficiency / less heat. Also fixed some exploits. Both the Tegra X1 & X1+ are found in the NVIDIA shield TV box as well.

Here is an output of /proc/cpuinfo:

processor	: 0
model name	: ARMv8 Processor rev 1 (v8l)
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x1
CPU part	: 0xd07
CPU revision	: 1

processor	: 1
model name	: ARMv8 Processor rev 1 (v8l)
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x1
CPU part	: 0xd07
CPU revision	: 1

processor	: 2
model name	: ARMv8 Processor rev 1 (v8l)
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x1
CPU part	: 0xd07
CPU revision	: 1

processor	: 3
model name	: ARMv8 Processor rev 1 (v8l)
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x1
CPU part	: 0xd07
CPU revision	: 1

Output of cpufetch --debug:

cpufetch v1.05-8-gdfa2 (Linux ARM build)
[Core 0] 0x411FD071 2091 MHz
[Core 1] 0x411FD071 2091 MHz
[Core 2] 0x411FD071 2091 MHz
[Core 3] 0x411FD071 2091 MHz

Output of lscpu:

Architecture:            aarch64
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               ARM
  Model name:            Cortex-A57
    Model:               1
    Thread(s) per core:  1
    Core(s) per cluster: 4
    Socket(s):           -
    Cluster(s):          1
    Stepping:            r1p1
    CPU max MHz:         2091.0000
    CPU min MHz:         102.0000
    BogoMIPS:            38.40
    Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32
Caches (sum of all):     
  L1d:                   128 KiB (4 instances)
  L1i:                   192 KiB (4 instances)
  L2:                    2 MiB (1 instance)

Thank you,

Sources:
https://www.nintendo.com/us/switch/tech-specs/#switch-section
https://en.wikipedia.org/wiki/Tegra#Tegra_X1
https://www.nvidia.com/en-us/shield/shield-tv/

@Dr-Noob
Copy link
Owner

Dr-Noob commented May 20, 2024

Awesome! Could you provide the output of cpufetch --verbose as well?

As far as I can see, /proc/cpuinfo does not provide information about the SoC so it is unlikely that the Soc and Technology field can be updated. cpufetch needs some way to determine that this is a Tegra X1 or, at least, that is a Nintendo Switch. I see that neofetch is able to detect this is a Switch, do you know how? I assume a hacky but effective way could be to inspect the list of pci devices, but this is not supported in cpufetch at the moment.

PS: Out of curiosity, is it difficult to install Ubuntu on the switch. I had the original 2017 model too and was wondering how easy would be to mess around it and install Ubuntu or other distro.

@Dr-Noob
Copy link
Owner

Dr-Noob commented May 20, 2024

Well, implementing it via PCI detection should not be that hard. I wonder if that would be enough to detect the SoC in this case.

Could you run grep '0x10de' /sys/bus/pci/devices/*/vendor 2> /dev/null? If that returns something, could you also run cat /sys/bus/pci/devices/XXXXXXX/device where XXXXXXX is the actual directory you found in the previous command?

If both returns sensible values, then it is indeed possible to detect the SoC using this approach (I assume that will depend on the level of support of the Linux kernel).

@WiiNewU
Copy link
Author

WiiNewU commented May 21, 2024

Hi, I run cpufetch with the --verbose option and it gave this output:
Screenshot_20240520_204035

This is also the output the the two commands:

root@switch:/home/switch# grep '0x10de' /sys/bus/pci/devices/*/vendor 2> /dev/null
/sys/bus/pci/devices/0000:00:02.0/vendor:0x10de

root@switch:/home/switch# cat /sys/bus/pci/devices/0x10de/device
cat: /sys/bus/pci/devices/0x10de/device: No such file or directory
root@switch:/home/switch# cat /sys/bus/pci/devices/0000:00:02.0/device
0x0faf

If you want to try switch Linux, This is a basic guide:

To boot Linux on a switch manufactured before march 2018, you will just need a little item called a RCM Jig (the RCM loader is not needed) for about a ~$5 on Amazon. As well as a USB type c cable. Switches made after March 2018 need a modchip installed. The only software you will need is the switch homebrew boot loader called hekate, a separate GUI add on for hekate, as well as a software on a Linux PC called fusee-interfacee-tk.

I do not recommended booting into any custom firmware (CFW) such as atmosphere, and any other tools that tamper with Nintendo's and licensed third party's software. Your console can get quickly banned (with all sign in accounts too) if you are connected to the internet with any changes/payloads on the switch console. Nintendo does keep logs that are synced between them and your console too. Nintendo has also took legal action with some software that tampers with the Switch's OS or any licensed game (Like lockpickRCM & Yuzu). Luckily booting into Linux on the switch does completely by pass the Switch's OS and licensed games (and does not tamper with it in any why) so it should be OK.

First you will need to have a microSD card with at least 32GB of storage. Also highly recommended to have a SD card with a high amounts of IOPS (random read/write speed) for the card. you will create the first partition with a 8GB fat32 filesystem where you will put the hextrate's bootloader folder, all the contents of the bootlogos.zip folder, and the install files for a switch Linux distro. The rest of the sd card will be a empty ext4 partition for the installer to write to.

To boot into hextrate, you run the fusee-interfacee-tk using sudo on your Linux PC, with the USB cable in the PC and SD card in the switch, slide the RCM Jig where the right joy-con is docked and then press & hold the vol+ button while plugging in the USB C cable into the switch, you console should boot to what is called RCM mode (there will be nothing on the screen, but fusee-interfacee-tk will tell you that the switch is ready). Using fusee-interfacee-tk load and send the hekate bin file and your console should now be in hextrate!, Just do not boot into any the sub options of the Launch section since your at risk of banning your console.

You can follow this guide of to find a l4t/switchroot Linux for switch install image, set it up. and when done your you can boot into Linux under the "More configs" section. They also switchroot just released a port of Ubuntu 24.04 (Kubuntu & Unity) as well.

You can follow this guide to install switch Linux:
https://wiki.switchroot.org/wiki/linux/l4t-ubuntu-noble-installation-guide

See what disros are available to download/install:
https://wiki.switchroot.org/wiki/linux/linux-distributions

Needed sd files (other then Linux):
https://nh-server.github.io/switch-guide/files/bootlogos.zip
https://github.com/CTCaer/hekate/releases/download/v6.1.1/hekate_ctcaer_6.1.1_Nyx_1.6.1.zip
https://github.com/nh-server/fusee-interfacee-tk/releases/download/V1.0.1/fusee-interfacee-tk-linux.zip

About new Ubuntu 24.04 switch release:

https://www.omgubuntu.co.uk/2024/05/ubuntu-24-04-nintendo-switch

@WiiNewU
Copy link
Author

WiiNewU commented May 22, 2024

The program hardinfo also states that its a 2017 Nintendo switch as well. Its likely that there detecting the motherboards model name. I'm just wondering which linux file would show the motherboard model then we know that it will be the right CPU.

@Dr-Noob
Copy link
Owner

Dr-Noob commented May 29, 2024

I have implemented the SoC detection based on the PCI devices, as discussed, in a new branch called switch. Could you give it a try and report back the results?

@Dr-Noob Dr-Noob added the enhancement New feature or request label May 29, 2024
@WiiNewU
Copy link
Author

WiiNewU commented May 31, 2024

@Dr-Noob Hello, It works (on a 2017 switch)! Thank you.
Screenshot_20240530_213423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants