|
|
In order to be able to load and unload models without crashing your system, the cores you plan using for real time models must be isolated. This is done by editing the kernel's command line parameters.
|
|
|
|
|
|
## Figuring out the number of cores you have
|
|
|
```
|
|
|
$ sudo apt -y install coreutils #Install coreutils for nproc
|
|
|
$ nproc --all
|
|
|
8
|
|
|
```
|
|
|
We have 8 CPUs, this example will isolate the top 6 of them, because some cores are needed for other Linux/RTS housekeeping processes. To do so add the cmdline option and update your grub configuration.
|
|
|
Because we have 8 CPUs, this example will isolate the top 6 of them, some cores are still needed for other Linux/RTS housekeeping processes.
|
|
|
|
|
|
## Isolation Configuration
|
|
|
We can update the Linux boot cmdline options by updating the grub configuration.
|
|
|
|
|
|
```
|
|
|
$ sudo vim /etc/default/grub
|
... | ... | @@ -13,7 +17,7 @@ $ sudo vim /etc/default/grub |
|
|
|
|
|
Uncomment or add the line (example for 8 cores):
|
|
|
```
|
|
|
GRUB_CMDLINE_LINUX="isolcpus=1-7"
|
|
|
GRUB_CMDLINE_LINUX="isolcpus=2-7"
|
|
|
```
|
|
|
|
|
|
Update your grub config and reboot.
|
... | ... | @@ -22,7 +26,7 @@ sudo update-grub |
|
|
sudo reboot
|
|
|
```
|
|
|
|
|
|
Now cores 1-7 have been isolated, so we can load/unload modules on them.
|
|
|
Now cores 2-7 have been isolated, so we can load/unload modules on them.
|
|
|
|
|
|
### Other notes
|
|
|
Starting with Debian 11 (Kernel 5.10) the real time custom kernel patch was replaced with a loadable CPU isolating kernel module. This means we don't need a custom kernel anymore, but this isolation step is required to keep the system from crashing when loading/unloading modules. |
|
|
\ No newline at end of file |