RedHawk リアルタイムコンテナイメージは、Concurrent Real-Timeによって開発されたXの動作するコンテナイメージです。
RedHawk7.0以上のベアメタルOSで、DockerあるいはPodmanを動作させ、その上のリアルタイムコンテナとして、利用可能です。
RedHawkの動作する最新ハードウェア上で、レガシィシステムのプログラムを、ほぼ変更なく動作させることができます。
一般的な制限事項は、ベアメタル側のカーネルとドライバをコンテナから呼び出すため、コンテナから利用するライブラリとドライバが密に結びついているものは、移植する必要があります。
この代表的なものは、Nvidia-GLXドライバとライブラリであり、RedHawkコンテナには、ベアメタル側と同一のGLXライブラリを含みます。
従って、CUDAプログラムのバイナリであるCUbinファイルは動作しないことがあります。
現在利用可能なコンテナイメージは、7.2.0,8.4です。
7.2と8.4のコンテナイメージではNVIDIA GLX550.67/CUDA12.4がインストールされました。
CUDA12.4の制限で、コンテナ上でcudaを利用する場合には、gcc 7.3.1 (devtoolset-7) & cmake 3.10.3 .をインストールする必要があります。
# dnf install lightdm
:
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
準備 : 1/1
インストール中 : lightdm-gobject-1.30.0-19.el8.x86_64 1/3
scriptletの実行中: lightdm-gtk-2.0.8-4.el8.x86_64 2/3
インストール中 : lightdm-gtk-2.0.8-4.el8.x86_64 2/3
scriptletの実行中: lightdm-1.30.0-19.el8.x86_64 3/3
インストール中 : lightdm-1.30.0-19.el8.x86_64 3/3
scriptletの実行中: lightdm-1.30.0-19.el8.x86_64 3/3
検証 : lightdm-1.30.0-19.el8.x86_64 1/3
検証 : lightdm-gobject-1.30.0-19.el8.x86_64 2/3
検証 : lightdm-gtk-2.0.8-4.el8.x86_64 3/3
インストール済みの製品が更新されています。
インストール済み:
lightdm-1.30.0-19.el8.x86_64 lightdm-gobject-1.30.0-19.el8.x86_64
lightdm-gtk-2.0.8-4.el8.x86_64
完了しました!
# systemctl disable gdm; systemctl enable lightdm
# reboot
RedHwk8.0.xの場合
# rpm -e \
runc-1.0.0-70.rc92.module_el8.3.0+699+d61d9c41.x86_64 \
buildah-1.11.6-7.module_el8.2.0+305+5e198a41.x86_64 \
cockpit-podman-12-1.module_el8.2.0+305+5e198a41.noarch \
podman-1.6.4-10.module_el8.2.0+305+5e198a41.x86_64
RedHwk8.2.xの場合
# rpm -e \
cockpit-podman-12-1.module_el8.2.0+305+5e198a41.noarch \
podman-catatonit-2.2.1-7.module_el8.3.0+699+d61d9c41.x86_64 \
podman-2.2.1-7.module_el8.3.0+699+d61d9c41.x86_64
(2) Docker CEをインストールする
# rpm -Uvh --nodigest --nofiledigest \
containerd.io-1.4.4-3.1.el8.x86_64.rpm \
fuse3-3.2.1-12.el8.x86_64.rpm \
fuse3-libs-3.2.1-12.el8.x86_64.rpm \
libslirp-4.3.1-2.el8.x86_64.rpm \
docker-ce-20.10.5-3.el8.x86_64.rpm \
docker-ce-cli-20.10.5-3.el8.x86_64.rpm \
docker-ce-rootless-extras-20.10.5-3.el8.x86_64.rpm
:
load-module module-native-protocol-unix
load-module module-native-protocol-unix socket=/tmp/.pulseaudio.socket
:
(2) あるいは、ベアメタル側でコンテナ実行前に、以下のコマンドを実行する。
# pacmd load-module module-native-protocol-unix socket=/tmp/.pulseaudio.socket
default-server = unix:/tmp/.pulseaudio.socket
autospawn = no
enable-shm = false
# export PULSE_SERVER=unix:/tmp/.pulseaudio.socket
# export PULSE_COOKIE=/tmp/.pulseaudio.cookie
# mv /usr/bin/chvt /usr/bin/chvt.bin
# ln -s /usr/bin/chvt.sh /usr/bin/chvt
下記の/usr/bin/chvt.shを作成する。
# cat /usr/bin/chvt.sh
#!/bin/sh
#
# This is a shell script to avoid running chvt 1.
# Running "chvt 1" from Xorg in a container where RedHawk8 is a bare metal OS causes the system to hang.
# Concurrent Real-Time
#
if [ -z "$1" ]
then
exit 1
fi
if [ "$1" == "1" ]
then
echo "Error: change foreground virtual terminal number."
echo "You cannot run \"chvt 1\" from the container."
echo "Normally \"chvt 2\" is used."
echo -e "\tchvt N"
echo -e "\t(with N in the range 2-12)"
else
/usr/bin/chvt.bin $1
fi
# mv /usr/bin/uname /usr/bin/uname.bin
# ln -s /usr/bin/uname.sh /usr/bin/uname
下記の/usr/bin/uname.shを作成する。
#!/bin/sh
usage()
{
echo "Usage: uname [OPTION]..."
echo "Print certain system information. With no OPTION, same as -s."
echo ""
echo " -a, --all print all information, in the following order,"
echo " except omit -p and -i if unknown:"
echo " -s, --kernel-name print the kernel name"
echo " -n, --nodename print the network node hostname"
echo " -r, --kernel-release print the kernel release"
echo " -v, --kernel-version print the kernel version"
echo " -m, --machine print the machine hardware name"
echo " -p, --processor print the processor type or "unknown""
echo " -i, --hardware-platform print the hardware platform or "unknown""
echo " -o, --operating-system print the operating system"
if [ "$LANG" == "ja_JP.UTF-8" ]
then
echo " --help この使い方を表示して終了"
echo " --version バージョン情報を表示して終了"
else
echo " --help display this help and exit"
echo " --version output version information and exit"
fi
echo ""
echo "Report uname bugs to bug-coreutils@gnu.org"
echo "GNU coreutils home page: "
echo "General help using GNU software: "
echo "Report uname translation bugs to "
echo "For complete documentation, run: info coreutils 'uname invocation'"
}
#注6.0.2を模擬する場合
R="2.6.36.4-RedHawk"$FLAVOR
V="#1 SMP PREEMPT Thu Feb 26 16:18:08 JST 2015"
#注6.5.6を模擬する場合
R="3.10.82-rt89-RedHawk-6.5.6"$FLAVOR
V="#1 SMP PREEMPT Wed Oct 21 16:50:54 EDT 2015"
#7.2を模擬する場合
R="4.1.15-rt17-RedHawk-7.2"$FLAVOR
V="#1 SMP PREEMPT Wed Mar 9 18:01:52 EST 2016"
FLAVOR=`cat /proc/ccur/flavor`
S=`/bin/uname.bin -s`
N=`/bin/uname.bin -n`
M=`/bin/uname.bin -m`
P=`/bin/uname.bin -p`
I=`/bin/uname.bin -i`
O=`/bin/uname.bin -o`
case "$1" in
-a) echo $S" "$N" "$R" "$V" "$M" "$P" "$I" "$O ;;
--all) echo $S" "$N" "$R" "$V" "$M" "$P" "$I" "$O ;;
-s) echo $S;;
--kernel-name) echo $S;;
-n) echo $N;;
--nodename) echo $N;;
-r) echo $R;;
--kernel-release) echo $R;;
-v) echo $V;;
--kernel-version) echo $V;;
-m) echo $M;;
-p) echo $P;;
-i) echo $I;;
-o) echo $O;;
--operating-system) echo $O;;
--help) usage ;;
--version)
echo "uname (GNU coreutils) 8.4"
echo "Copyright (C) 2010 Free Software Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later ."
echo "This is free software: you are free to change and redistribute it."
echo "There is NO WARRANTY, to the extent permitted by law."
echo ""
if [ "$LANG" == "ja_JP.UTF-8" ]
then
echo "作者 David MacKenzie."
else
echo "Written by David MacKenzie."
fi
;;
"") echo $S;;
*) usage ;;
esac
exit 0;
# ls -l /dev/input/by-path/*usb*-event-kbd* /dev/input/by-path/*usb*-event-mouse*
lrwxrwxrwx 1 root root 9 8月 27 13:20 /dev/input/by-path/pci-0000:00:14.0-usb-0:14:1.0-event-mouse -> ../event5
lrwxrwxrwx 1 root root 9 8月 27 13:20 /dev/input/by-path/pci-0000:00:14.0-usb-0:4:1.0-event-kbd -> ../event3
lrwxrwxrwx 1 root root 9 8月 27 13:27 /dev/input/by-path/pci-0000:00:14.0-usb-0:8.1:1.0-event-mouse -> ../event8
lrwxrwxrwx 1 root root 9 8月 27 13:21 /dev/input/by-path/pci-0000:00:14.0-usb-0:8.2:1.0-event-kbd -> ../event6
#
# ベアメタル側 /etc/X11/xorg.conf
#
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "IsolateDevice" "PCI:23:0:0"
Option "Sharevts" "True"
EndSection
Section "Files"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputClass"
Identifier "ContainerDevice"
MatchDevicePath "/dev/input/event[68]"
Option "Ignore" "True"
EndSection
Section "InputClass"
Identifier "HostDevice"
MatchDevicePath "/dev/input/enevt[35]"
Option "Ignore" "False"
Driver "evdev"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:23:0:0"
Option "UseDisplayDevice" "DP-3"
Option "ProbeAllGpus" "false"
Option "MultiGPU" "no"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
Section "SERVERFLAGS"
Option "MaxClients" "512"
# Option "DontVTSwitch" "yes"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
Option "AutoAddGPU" "false"
EndSection
#
# コンテナ側 /etc/X11/xorg.conf
#
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "IsolateDevice" "PCI:6:0:0"
EndSection
Section "Files"
FontPath "/usr/share/fonts/default/Type1"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "evdev"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputClass"
Identifier "HostDevice"
MatchDevicePath "/dev/input/event[35]"
Option "Ignore" "True"
EndSection
Section "InputClass"
Identifier "ContainerDevice"
MatchDevicePath "/dev/input/enevt[68]"
Option "Ignore" "False"
Driver "evdev"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "evdev"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:6:0:0"
Option "ProbeAllGpus" "false"
Option "MultiGPU" "no"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
Section "SERVERFLAGS"
Option "MaxClients" "512"
Option "DontVTSwitch" "yes"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
#Option "AutoEnableDevices" "false"
Option "AutoAddGPU" "false"
EndSection