Linux disable device at boot

How do I disable a specific CPU core at boot?

I have a 16 core Intel Xeon processor that successfully boots into the BIOS and GRUB, but fails to load Ubuntu (or any operating system). It turns out that core #14 is the cause of all the issues (discovered after testing each individual core with memtest86). In the BIOS, I can set the system to run with just 2 cores, and the system works in this configuration. But I would like to be able to use 15 out of 16 of the cores. Is there a way to disable only core #14 at boot?

very cool using memtest86 to test each core. I didn’t know you could do that, but checked and see the «select core» option.

Thanks. The problem originally presented itself as failed RAM, and booting into Ubuntu would get stuck at «loading initial ramdisk». But the (parallel) memory test showed all 4 modules as dead, which seemed unlikely. So I tried the round-robin test, which passed until it got to core #14.

I would get a new CPU. Maybe even contact Intel to see if there is a recall for manufacturing defect and a free one is available.

@WinEunuuchs2Unix : A single package 16 core, 32 thread, Xeon processor is very very expensive. I think what Samyah93 has figured out to be able to continue is brilliant.

1 Answer 1

You can make use of CPU hotplug abilities to achieve your objective. You can boot CPUs 0-13 and then add the others (CPUs 15-27, and 29-31) afterwards.

All Xeon processors have hyper threading, so I assume you mean 16 cores at 2 threads per core, for a total of 32 CPUs. This answer is written, and tested, for a 4 core, 2 threads per core, processor, where core 2 is the bad one.

Читайте также:  Notabug genshin impact linux

First, as sudo, edit /etc/default/grub and add the maximum boot time CPUs, maxcpus= , to your GRUB_CMDLINE_LINUX_DEFAULT line. Example for my system:

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 consoleblank=300 cpuidle_sysfs_switch cpuidle.governor=teo" 
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 consoleblank=300 cpuidle_sysfs_switch cpuidle.governor=teo maxcpus=2" 

Where I used maxcpus=2 you would use maxcpus=14 .

Save a copy of grub first, and run sudo update-grub after. Thus, the system will boot only using cores 0 and 1, and in CPUs 0,1 being on-line:

doug@s15:~$ grep . /sys/devices/system/cpu/cpu*/online /sys/devices/system/cpu/cpu1/online:1 /sys/devices/system/cpu/cpu2/online:0 /sys/devices/system/cpu/cpu3/online:0 /sys/devices/system/cpu/cpu4/online:0 /sys/devices/system/cpu/cpu5/online:0 /sys/devices/system/cpu/cpu6/online:0 /sys/devices/system/cpu/cpu7/online:0 

Note: For the default Ubuntu kernel configurations CPU 0 is always online, and there is no such thing as:

doug@s15:~$ grep . /sys/devices/system/cpu/cpu0/online grep: /sys/devices/system/cpu/cpu0/online: No such file or directory 

O.K. so now, bring the other desired cores and CPUs on-line:

doug@s15:~$ echo 1 | sudo tee /sys/devices/system/cpu/cpu3/online 1 doug@s15:~$ echo 1 | sudo tee /sys/devices/system/cpu/cpu4/online 1 doug@s15:~$ echo 1 | sudo tee /sys/devices/system/cpu/cpu5/online 1 doug@s15:~$ echo 1 | sudo tee /sys/devices/system/cpu/cpu7/online 
doug@s15:~$ grep . /sys/devices/system/cpu/cpu*/online /sys/devices/system/cpu/cpu1/online:1 /sys/devices/system/cpu/cpu2/online:0 /sys/devices/system/cpu/cpu3/online:1 /sys/devices/system/cpu/cpu4/online:1 /sys/devices/system/cpu/cpu5/online:1 /sys/devices/system/cpu/cpu6/online:0 /sys/devices/system/cpu/cpu7/online:1 

So now, I have cores 0,1,3 on-line and core 2 offline and 6 CPUs available. Note that core 0 = cpus 0 and 4, core 1 = cpus 1 and 5, .

EDIT 1: For 32 CPUs, perhaps you have multiple nodes (processors), so the core to CPU mapping might be different.

EDIT 2: It may be that the CPUs that are brought on-line after boot default to using the performance governor in the intel_pstate CPU frequency scaling driver, which is the kernel configuration default (which gets changed to powersave 1 minute after boot, for the boot enabled CPUs). You might want to check and set all CPU governors to your preference, typically the powersave governor. To check do:

grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 

To change governors do, for example (notice as root):

# for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "powersave" > $file; done 

Once you have things working the way you want you can automate the additional on-line after boot step (see other questions and answers for «how to»).

Читайте также:  Ace stream media linux

Note: It seems to me that you should be able to achieve your objective in one boot step via «cpu_possible_mask» manipulation via «possible_cpus=n», but I couldn’t get it to work. Someone else might know.

Источник

How to disable PCIe device at boot?

I’m trying to debug an issue with resuming from suspend with an NVIDIA graphics card. This thread leads me to believe it’s an issue with the audio device from the card’s HDMI out. I want to disable the device, but udev rules and kernel parameters have no effect. How can I either troubleshoot these methods not working or use another way to disable the device so that I can absolutely rule out the possibility that it’s causing my issue? sudo lspci -vv output for my device in question (irrelevant fields removed):

58:00.1 Audio device: NVIDIA Corporation Device 10fa (rev a1) Subsystem: Micro-Star International Co., Ltd. [MSI] Device 3800 Control: (. ) Status: (. ) Latency: 0 Interrupt: pin B routed to IRQ 18 IOMMU group: 19 Region 0: Memory at 61080000 (32-bit, non-prefetchable) [size=16K] Capabilities: (. ) Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel 
58:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:10fa] (rev a1) 
cat /etc/udev/rules.d/10-remove-nvidia-audio.rules ACTION==“add”, KERNEL=="0000:58:00.1", SUBSYSTEM=="pci", RUN="/bin/sh -c ‘echo 1 > /sys/bus/pci/devices/0000:58:00.1/remove’" 

Running the RUN command manually does disconnect the device but the suspend issue still exists, and I have no way of determining whether the device is reconnected on resume ( journalctl only logs up to the suspend operation, does not log anything about resume, assuming that’s because I have to force power off to use my computer again). Is there something else I need to do to have a udev rule take effect?

pcistub=pci-stub.ids=10de:10fa 

I can’t use the other method outlined in the answer I looked at, because snd_hda_intel is used for my actual audio output as well.

Читайте также:  Сортировка файлов по дате изменения linux

Any suggestions are appreciated. Thanks!

Источник

disable specific PCI device at boot

I’ve just reinstalled Debian on my Sony VAIO laptop, and my dmesg and virtual consoles all get spammed with the same messages over and over again.

[ 59.662381] hub 1-1:1.0: unable to enumerate USB device on port 2 [ 59.901732] usb 1-1.2: new high-speed USB device number 91 using ehci_hcd [ 59.917940] hub 1-1:1.0: unable to enumerate USB device on port 2 [ 60.157256] usb 1-1.2: new high-speed USB device number 92 using ehci_hcd 

I believe these messages are coming from an internally connected USB device, most likely the webcam (since that’s the only thing that doesn’t work). The only way I can seem to have it shut up (without killing my actually useful USB ports) is to disable one of the USB host controllers:

# echo "0000:00:1a.0" > /sys/bus/pci/drivers/ehci_hcd/unbind 

This also takes down my Bluetooth interface, but I’m fine with that. I would like this setting to persist, so that I can painlessly use my virtual console again in case I need it. I want my operating system (Debian amd64) to never wake it up, but I don’t know how to do this. I’ve tried to blacklist the module alias for the PCI device, but it seems to be ignored:

$ cat /sys/bus/pci/devices/0000\:00\:1a.0/modalias pci:v00008086d00003B3Csv0000104Dsd00009071bc0Csc03i20 $ cat /etc/modprobe.d/blacklist blacklist pci:v00008086d00003B3Csv0000104Dsd00009071bc0Csc03i20 

How do I ensure that this specific PCI device is never automatically activated, without disabling its driver altogether? -edit- The module was renamed recently, now the following works from userland:

echo "0000:00:1a.0" > /sys/bus/pci/drivers/ehci-pci/unbind 

Источник

Оцените статью
Adblock
detector