PCIe Passthrough - Cuda funktioniert nicht richtig

Kalone

Member
Feb 20, 2021
29
0
6
Moin,

ich habe eine Frage was mich in letzter Zeit auf meinem System beschäftigt. Ich habe meine GTX 1050 Ti durchgereicht an ein Linux Ubuntu 21.10 Guest System und die Treiber + Cuda installiert. Auf den ersten Blick scheint die Installation erfolgreich gewesen zu sein, allerdings habe ich jetzt testweise versucht diese Konfiguration mit Mining zu testen, was leider nicht erfolgreich war.

Code:
$ nvidia-smi
Mon Apr 18 18:57:02 2022    
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| 36%   41C    P0    N/A /  75W |    547MiB /  4037MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                           
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       822      G   /usr/lib/xorg/Xorg                218MiB |
|    0   N/A  N/A      1199      G   /usr/bin/kwin_x11                  38MiB |
|    0   N/A  N/A      1346      G   /usr/bin/plasmashell               42MiB |
|    0   N/A  N/A      1483      G   /usr/lib/firefox/firefox          133MiB |
|    0   N/A  N/A      1998      C   /usr/NX/bin/nxnode.bin             79MiB |
|    0   N/A  N/A      2505      G   ...-token=706490012959216100       24MiB |
+-----------------------------------------------------------------------------+

Code:
nvcc --versionnvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0

Für den Passthrough am Proxmox habe ich eine Anleitung befolgt: https://www.reddit.com/r/homelab/comments/b5xpua/the_ultimate_beginners_guide_to_gpu_passthrough/

Screenshot 2022-04-18 at 19-00-21 proxmox - Proxmox Virtual Environment.pngScreenshot 2022-04-18 at 20-22-08 proxmox - Proxmox Virtual Environment.png

Im Guest selbst, habe ich nun cudominer installiert, leider wird dort die GPU nicht angezeigt. Mittels XMRig-Cuda hat es auch nicht funktioniert. Geht mir hier jetzt nicht direkt ums Mining, da meine Hardware eh nicht dafür geeignet ist, sondern primär nur, dass es überhaupt funktioniert, da ich für die Zukunft gerne mit dem System rendern oder ähnliches möchte und es nett wäre, auch alle Features verwenden zu können. ;-)

Ich verstehe nicht, warum das solche Problem bereitet und nicht läuft, auf einem anderen Linux-Host, auf dem Linux baremetal läuft, konnte ich das erfolgreich testen.... vielleicht weiß einer von euch einen Rat, würde mich wirklich freuen, Danke!
miningtest.png

Viele Grüße
 
Last edited:
Noch ein paar Informationen zu meiner Proxmox Passthrough Konfiguration:

nano /etc/default/grub

Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt"

nano /etc/modules

Code:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

/etc/modprobe.d/iommu_unsafe_interrupts.conf

Code:
options vfio_iommu_type1 allow_unsafe_interrupts=1

/etc/modprobe.d/kvm.conf

Code:
options kvm ignore_msrs=1


/etc/modprobe.d/blacklist.conf

Code:
  GNU nano 5.4                                                    /etc/modprobe.d/blacklist.conf                                                             
blacklist radeon
blacklist nouveau
blacklist nvidia

lspci -v

Code:
05:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: Gigabyte Technology Co., Ltd GP107 [GeForce GTX 1050 Ti]
        Physical Slot: 5
        Flags: fast devsel, IRQ 11, IOMMU group 36
        Memory at f2000000 (32-bit, non-prefetchable) [disabled] [size=16M]
        Memory at d0000000 (64-bit, prefetchable) [disabled] [size=256M]
        Memory at e0000000 (64-bit, prefetchable) [disabled] [size=32M]
        I/O ports at 2000 [disabled] [size=128]
        Expansion ROM at f3080000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Legacy Endpoint, MSI 00
        Capabilities: [100] Virtual Channel
        Capabilities: [250] Latency Tolerance Reporting
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [420] Advanced Error Reporting
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Capabilities: [900] Secondary PCI Express
        Kernel driver in use: vfio-pci
        Kernel modules: nvidiafb, nouveau

05:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1)
        Subsystem: Gigabyte Technology Co., Ltd GP107GL High Definition Audio Controller
        Physical Slot: 5
        Flags: fast devsel, IRQ 10, IOMMU group 36
        Memory at f3000000 (32-bit, non-prefetchable) [disabled] [size=16K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Kernel driver in use: vfio-pci
        Kernel modules: snd_hda_intel

lspci -n -s 05:00

Code:
05:00.0 0300: 10de:1c82 (rev a1)
05:00.1 0403: 10de:0fb9 (rev a1)

/etc/modprobe.d/vfio.conf

Code:
options vfio-pci ids=10de:1c82,10de:0fb9 disable_vga=1


Die Guest Konfiguration:

Code:
agent: 1
audio0: device=ich9-intel-hda,driver=none
bios: ovmf
boot: order=scsi0;ide2;net0
cores: 12
cpu: host
efidisk0: sdb:vm-222-disk-0,efitype=4m,pre-enrolled-keys=1,size=1M
hostpci0: 0000:05:00,pcie=1,x-vga=1
ide2: truenas:iso/kubuntu-21.10-desktop-amd64.iso,media=cdrom
machine: q35
memory: 10256
meta: creation-qemu=6.2.0,ctime=1650229045
name: kubuntu-21-10
net0: e1000=EE:38:0B:71:81:E0,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsi0: sdb:vm-222-disk-1,backup=0,cache=unsafe,size=40G
scsihw: virtio-scsi-pci
smbios1: uuid=cf4ec510-556d-43ae-b257-fa55094ec7d9
sockets: 1
vga: none
vmgenid: 8bf1480b-9cc7-4c53-9c81-3a207a8ea391

Vielleicht fällt jemanden noch was ein?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!