Cuda(arch linux)用のEGPUを含むマルチNVIDIA RTX GPU

Cuda(arch linux)用のEGPUを含むマルチNVIDIA RTX GPU

アーチLinux、ラップトップには2つのGPUがあります(Thinkpad P14s第4世代)+ Cool Master EG200 GPUケースを使用してThunderbolt 4を介して接続された新しいRTX 3090:

❯ lspci -k | grep -A 2 -E "(VGA|3D)"
00:02.0 VGA compatible controller: Intel Corporation Raptor Lake-P [Iris Xe Graphics] (rev 04)
        Subsystem: Lenovo Raptor Lake-P [Iris Xe Graphics]
        Kernel driver in use: i915
--
03:00.0 3D controller: NVIDIA Corporation GA107GLM [RTX A500 Laptop GPU] (rev a1)
        Subsystem: Lenovo GA107GLM [RTX A500 Laptop GPU]
        Kernel driver in use: nvidia
--
22:00.0 VGA compatible controller: NVIDIA Corporation GA102 [GeForce RTX 3090] (rev a1)
        Subsystem: Gigabyte Technology Co., Ltd GA102 [GeForce RTX 3090]
        Kernel driver in use: nvidia

RTX 3090へのThunderbolt接続は、次のように認証されます。

❯ sudo boltctl info c4010000-0070-740e-0362-00168691c921
[sudo] password for aemonge: 
 ● Cooler Master Technology,Inc MasterCase EG200
   ├─ type:          peripheral
   ├─ name:          MasterCase EG200
   ├─ vendor:        Cooler Master Technology,Inc
   ├─ uuid:          c4010000-0070-740e-0362-00168691c921
   ├─ dbus path:     /org/freedesktop/bolt/devices/c4010000_0070_740e_0362_00168691c921
   ├─ generation:    Thunderbolt 3
   ├─ status:        authorized
   │  ├─ domain:     69078780-60ab-fe2a-ffff-ffffffffffff
   │  ├─ parent:     69078780-60ab-fe2a-ffff-ffffffffffff
   │  ├─ syspath:    /sys/devices/pci0000:00/0000:00:0d.2/domain0/0-0/0-1
   │  ├─ rx speed:   40 Gb/s = 2 lanes * 20 Gb/s
   │  ├─ tx speed:   40 Gb/s = 2 lanes * 20 Gb/s
   │  └─ authflags:  boot
   ├─ authorized:    Wed 24 Jan 2024 06:49:10 AM UTC
   ├─ connected:     Wed 24 Jan 2024 06:49:10 AM UTC
   └─ stored:        Tue 23 Jan 2024 03:50:50 PM UTC
      ├─ policy:     iommu
      └─ key:        no

私はグラフィックやxorgにロードされたRTX3090、グラフィックインターフェイスには全く興味がありません。私はそれをコンピューティング専用のワークロードとして使用したいと思い、このアーチウィキに完全に従いました。https://wiki.archlinux.org/title/External_GPU

ただし、この場合を考慮するとnvidia-smiGPUが見つかりません。

❯ nvidia-smi -L
GPU 0: NVIDIA RTX A500 Laptop GPU (UUID: GPU-762410c2-1c0d-ef4a-89ac-91afd926381b)

単純なPythonスクリプトも同様です。cuda-devices.py:

❯ cat cuda-devics.py
import torch

# Check if CUDA is available
if torch.cuda.is_available():
    print("CUDA is available.")
    # Get the number of CUDA devices
    num_devices = torch.cuda.device_count()
    print(f"Number of CUDA devices: {num_devices}")
    # Get the name of each CUDA device
    for i in range(num_devices):
        print(f"Device {i} name: {torch.cuda.get_device_name(i)}")
else:
    print("CUDA is not available.")
❯ python cuda-devics.py
CUDA is available.
Number of CUDA devices: 1
Device 0 name: NVIDIA RTX A500 Laptop GPU

❯ CUDA_VISIBLE_DEVICES="0,1,2" python cuda-devics.py

CUDA is available.
Number of CUDA devices: 1
Device 0 name: NVIDIA RTX A500 Laptop GPU

私もこの3つのリポジトリを試しましたhttps://github.com/ewagner12/all-ways-egpuhttps://github.com/karli-sjoberg/gswitchそしてhttps://github.com/hertg/egpu-switcher。内部GPUは無効になっているA500とIris Xeですが点滅します(黒い画面)。


解決済み

解決済みhttps://forums.developer.nvidia.com/t/multiple-nvidia-rtx-gpu-for-cuda-arch-linux-with-egpu/280031/7NVIDIA開発者フォーラム、著者:

ユニバーサル最優秀貢献者5時間

BIOSアップデートを確認してください。利用できない場合は、ソフトウェアとアップデートを使用して「-open」ドライババージョンに切り替え、カーネルパラメータnvidia.NVreg_OpenRmEnableUnsupportedGpus = 1を設定します。

これは次のことを意味します。

sudo pacman -S nvidia-open

/boot/loader/entries/*_linux.conf

# Created by: archinstall
# Created on: ***********
title   Arch Linux (linux)
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=PARTUUID=####-####-####### zswap.enabled=0 rw nvidia.NVreg_OpenRmEnableUnsupportedGpus=1 rootfstype=ext4

ベストアンサー1

おすすめ記事