<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Raymond P. Burkholder - Things I Do - Proxmox</title>
    <link>http://blog.raymond.burkholder.net/</link>
    <description>In And Around Technology and The Arts</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.7.2 - http://www.s9y.org/</generator>
    <pubDate>Mon, 27 Apr 2026 05:41:54 GMT</pubDate>

    <image>
        <url>http://blog.raymond.burkholder.net/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: Raymond P. Burkholder - Things I Do - Proxmox - In And Around Technology and The Arts</title>
        <link>http://blog.raymond.burkholder.net/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>NVidia GPU Passthrough to ProxMox LXC Container</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/1343-NVidia-GPU-Passthrough-to-ProxMox-LXC-Container.html</link>
            <category>Proxmox</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/1343-NVidia-GPU-Passthrough-to-ProxMox-LXC-Container.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=1343</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1343</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;https://www.virtualizationhowto.com/2025/05/how-to-enable-gpu-passthrough-to-lxc-containers-in-proxmox/&quot; target=_blank&gt;How to Enable GPU Passthrough to LXC Containers in Proxmox&lt;/a&gt; indicates that the process of providing passthrough of a GPU to both an LXC container as well as a Virtual Machine is not possible as the two types of configurations conflict with each other.

&lt;p&gt;As my own preference is to run whatever possible in LXC containers, I&#039;ll summarize the configuration I used, which is an amalgamation of configurations from several sites.
&lt;p&gt;My current installation is ProxMox v9.1.6 with:

&lt;ul&gt;
  &lt;li&gt;ProArt Z890-CREATOR WIFI
  &lt;li&gt;Intel(R) Core(TM) Ultra 9 285K
  &lt;li&gt;Corsair CMP64GX5M2X6600C32 (128G  4400 MT/s) - ECC would have been nice
  &lt;li&gt;NVIDIA Corporation AD103 [GeForce RTX 4070] (rev a1)
  &lt;/ul&gt;

&lt;p&gt;In BIOS/UEFI, enable these:
&lt;ul&gt;
  &lt;li&gt;VT-d / IOMMU
  &lt;li&gt;Above 4G Decoding
  &lt;li&gt;PCIe Native Power Management (if available)
  &lt;/ul&gt;

&lt;p&gt;Proxmox kernel parameters:
&lt;blockquote&gt;&lt;pre&gt;
# /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT=&quot;quiet intel_iommu=on iommu=pt pcie_acs_override=downstream,multifunction&quot;

update-grub
reboot
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.kernel.org/doc/html/latest/driver-api/vfio.html&quot; target=_blank&gt;VFIO Binding&lt;/a&gt; - optional but recommended:
&lt;blockquote&gt;&lt;pre&gt;
# /etc/modprobe.d/vfio.conf
options vfio_iommu_type1 allow_unsafe_interrupts=1
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Obtain Linux drivers from &lt;a href=&quot;https://www.nvidia.com/en-us/drivers/&quot; target=_blank&gt;NVidia&lt;/a&gt;.  The CUDA toolkit is not required.  Only the drivers are required in ProxMox.  Toolkits and add-ons are added within the container.

&lt;p&gt;Install the drivers:
&lt;blockquote&gt;&lt;pre&gt;
apt install build-essential
apt install pve-headers-$(uname -r)
sh NVIDIA-Linux-x86_64-595.58.03.run
# note, use the open kernel, rather than proprietary
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Blacklist nouveau:
&lt;blockquote&gt;&lt;pre&gt;
cat &gt; /etc/modprobe.d/blacklist-nouveau.conf &lt;&lt; EOF
blacklist nouveau
options nouveau modeset=0
EOF
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Test that the card is accessible:
&lt;blockquote&gt;&lt;pre&gt;
nvidia-smi
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Enable &lt;a href=&quot;https://docs.nvidia.com/deploy/driver-persistence/data-persistence.html&quot; target=_blank&gt;Data Persistence&lt;/a&gt; to prevent the GPU from re-initializing with each use.
&lt;blockquote&gt;&lt;pre&gt;
nvidia-persistenced --persistence-mode
systemctl enable nvidia-persistenced
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Then restart:
&lt;blockquote&gt;&lt;pre&gt;
reboot
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Identify the nvidia devices requiring passthrough:
&lt;blockquote&gt;&lt;pre&gt;
root@host02:~# ls -al /dev/nvidia*
crw-rw-rw- 1 root root 195,   0 Mar 28 11:58 /dev/nvidia0
crw-rw-rw- 1 root root 195, 255 Mar 28 11:58 /dev/nvidiactl
crw-rw-rw- 1 root root 505,   0 Mar 28 11:58 /dev/nvidia-uvm
crw-rw-rw- 1 root root 505,   1 Mar 28 11:58 /dev/nvidia-uvm-tools

/dev/nvidia-caps:
total 0
drwxr-xr-x  2 root root     80 Mar 28 11:58 .
drwxr-xr-x 21 root root   5060 Mar 28 11:58 ..
cr--------  1 root root 508, 1 Mar 28 11:58 nvidia-cap1
cr--r--r--  1 root root 508, 2 Mar 28 11:58 nvidia-cap2
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Note the numbers 195, 505 and 508 in this list (yours may be different).

&lt;p&gt;Construct a container, and prior to starting, place the following into /etc/pve/lxc/&amp;lt;vmid&amp;gt;.conf (based upon the device listing above):
&lt;blockquote&gt;&lt;pre&gt;
dev0: /dev/nvidia0
dev1: /dev/nvidiactl
dev2: /dev/nvidia-modeset
dev3: /dev/nvidia-uvm
dev4: /dev/nvidia-uvm-tools
dev5: /dev/nvidia-caps/nvidia-cap1
dev6: /dev/nvidia-caps/nvidia-cap2
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;These lines are optional in the config file, one site talks about them by my container seems to work without them  (they may be an old style cgroup2 style passthrough rather than the device oriented passthrough above):
&lt;blockquote&gt;&lt;pre&gt;
lxc.cgroup2.devices.allow: c 195:* rwm
lxc.cgroup2.devices.allow: c 505:* rwm
lxc.cgroup2.devices.allow: c 508:* rwm
&lt;/pre&gt;&lt;/blockquote&gt;


&lt;p&gt;Start the container and push the driver file into the container:
&lt;blockquote&gt;&lt;pre&gt;
pct push &amp;lt;vmid&amp;gt; downloads/NVIDIA-Linux-x86_64-595.58.03.run /root/NVIDIA-Linux-x86_64-595.58.03.run
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;In the container, install the driver, minus the kernel module:
&lt;blockquote&gt;&lt;pre&gt;
apt install kmod
sh NVIDIA-Linux-x86_64-595.58.03.run --no-kernel-modules
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Run nvidia-smi in the container to confirm the card is reachable.

&lt;p&gt;Add nvtop at the host or the container level to chart live GPU utllization:
&lt;blockquote&gt;&lt;pre&gt;
apt install nvtop
&lt;/pre&gt;&lt;/blockquote&gt;


&lt;p&gt;Additional resources:
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.reddit.com/r/Proxmox/comments/1s629rq/complete_gpu_passthrough_guide_for_ai_workloads_t/&quot; target=_blank&gt;Complete GPU passthrough guide for AI workloads, avoid the mistakes I made so you don&#039;t have to &lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://forum.proxmox.com/threads/nvidia-drivers-instalation-proxmox-and-ct.156421/&quot; target=_blank&gt;[TUTORIAL] NVIDIA drivers instalation Proxmox and CT&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.virtualizationhowto.com/2025/05/how-to-enable-gpu-passthrough-to-lxc-containers-in-proxmox/&quot; target=_blank&gt;How to Enable GPU Passthrough to LXC Containers in Proxmox&lt;/a&gt; - contains ollama startup examples with OpenWebUI
  &lt;/ul&gt;

&lt;p&gt;Another type of test to run when pytorch is installed:
&lt;blockquote&gt;&lt;pre&gt;
python -c &quot;import torch; print(torch.cuda.is_available())&quot;
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;NOTE: for running in unprivileged container, some ideas in &lt;a href=&quot;https://jocke.no/2025/04/20/plex-gpu-transcoding-in-docker-on-lxc-on-proxmox-v2/&quot; target=_blank&gt;Plex GPU transcoding in Docker on LXC on Proxmox v2&lt;/a&gt;:

&lt;blockquote&gt;&lt;pre&gt;
# if you&#039;re running in unprivileged mode, you also need to add permissions
# you either add the lines above, or the lines below -- not both
# gid/uid might need to be changed to suit your lxc-setup
dev0: /dev/nvidia0,gid=1000,uid=1000
dev1: /dev/nvidiactl,gid=1000,uid=1000
dev2: /dev/nvidia-modeset,gid=1000,uid=1000
dev3: /dev/nvidia-uvm,gid=1000,uid=1000
dev4: /dev/nvidia-uvm-tools,gid=1000,uid=1000
dev5: /dev/nvidia-caps/nvidia-cap1,gid=1000,uid=1000
dev6: /dev/nvidia-caps/nvidia-cap2,gid=1000,uid=1000
dev7: /dev/dri/card0,gid=1000,uid=1000
dev8: /dev/dri/renderD128,gid=1000,uid=1000
&lt;/pre&gt;&lt;/blockquote&gt;
 
    </content:encoded>

    <pubDate>Sat, 28 Mar 2026 17:26:45 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/1343-guid.html</guid>
    
</item>
<item>
    <title>Ensuring nvidia drivers in Proxmox start up prior to containers</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/1354-Ensuring-nvidia-drivers-in-Proxmox-start-up-prior-to-containers.html</link>
            <category>Proxmox</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/1354-Ensuring-nvidia-drivers-in-Proxmox-start-up-prior-to-containers.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=1354</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1354</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;From &lt;a href=&quot;https://jocke.no/2025/04/20/plex-gpu-transcoding-in-docker-on-lxc-on-proxmox-v2/&quot; target=_blank&gt;Plex GPU transcoding in Docker on LXC on Proxmox v2&lt;/a&gt;:

&lt;blockquote&gt;&lt;pre&gt;
# make sure that all nvidia devices are loaded upon boot
cat &gt;/etc/systemd/system/nvidia-pre-lxc-init.service &lt;&lt;&#039;EOF&#039;
[Unit]
Description=Initialize NVIDIA devices early (before Proxmox guests)
After=systemd-modules-load.service
Before=pve-guests.service
Wants=pve-guests.service

[Service]
Type=oneshot
RemainAfterExit=yes

ExecStartPre=-/sbin/modprobe nvidia
ExecStartPre=-/sbin/modprobe nvidia_uvm
ExecStart=-/usr/bin/nvidia-smi -L
ExecStart=-/usr/bin/nvidia-modprobe -u -c=0

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable nvidia-pre-lxc-init.service
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;reboot then try nvidia-smi to confirm function. 
    </content:encoded>

    <pubDate>Mon, 27 Apr 2026 03:33:14 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/1354-guid.html</guid>
    
</item>
<item>
    <title>NUT UPS USB Connected to Proxmox Unprivileged LXC</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/1351-NUT-UPS-USB-Connected-to-Proxmox-Unprivileged-LXC.html</link>
            <category>Proxmox</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/1351-NUT-UPS-USB-Connected-to-Proxmox-Unprivileged-LXC.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=1351</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1351</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;Taking &lt;a href=&quot;https://forum.proxmox.com/threads/rtl_433-in-unprivileged-lxc-container-with-automatic-device-path-change.157192/&quot; target=_blank&gt;RTL_433 in unprivileged LXC container, with automatic device path change&lt;/a&gt; for inspiration, I was able to connect multiple APC and Eaton UPS USB cables to a server with the following mechanism.  I forwarded the USB connections into an LXC container as I use my &lt;a href=&quot;https://github.com/rburkholder/nut2mqtt&quot; target=_blank&gt;nut2mqtt - Communication between Network UPS Tools (NUT) and MQTT&lt;/a&gt; for monitoring.

&lt;p&gt;The Proxmox host is configured in a standard way using the primary UPS USB connection (still yet to try).

&lt;p&gt;As a USB cable is inserted, &quot;journalctl -f&quot; will log information similar to:

&lt;blockquote&gt;&lt;pre&gt;
Apr 25 15:48:21 host02 kernel: usb 3-4: new full-speed USB device number 10 using xhci_hcd
Apr 25 15:48:21 host02 kernel: usb 3-4: New USB device found, idVendor=051d, idProduct=0002, bcdDevice= 0.90
Apr 25 15:48:21 host02 kernel: usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 25 15:48:21 host02 kernel: usb 3-4: Product: Back-UPS XS 1300G FW:864.L6 .D USB FW:L6
Apr 25 15:48:21 host02 kernel: usb 3-4: Manufacturer: American Power Conversion
Apr 25 15:48:21 host02 kernel: usb 3-4: SerialNumber: 4B12P636
Apr 25 15:48:21 host02 kernel: hid-generic 0003:051D:0002.0007: hiddev3,hidraw5: ......
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Use &quot;lsusb&quot; to determine the bus and device assignment based upon the &#039;idVendor&#039; and &#039;idProduct&#039; assignments above:

&lt;blockquote&gt;&lt;pre&gt;
# lsusb -d 051d:0002
Bus 003 Device 010: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Thus you&#039;ll see an associated entry in /dev:

&lt;blockquote&gt;&lt;pre&gt;
~# ls -altr /dev/bus/usb/003/010
crw-rw-rw- 1 root root 189, 265 Apr 25 15:48 /dev/bus/usb/003/010
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Note the cgroup2 &#039;189, 265&#039; identifiers.  Adding an entry to your /etc/pve/lxc/&amp;lt;lxc-id&amp;gt;.conf entry will be required:

&lt;blockquote&gt;&lt;pre&gt;
lxc.cgroup2.devices.allow: c 189:* rwm
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Whenever the USB cable is plugged in, a different device may be constructed.  To pass that information to Proxmox for when it starts the container, use something like:

&lt;blockquote&gt;&lt;pre&gt;
# cat /etc/udev/rules.d/50-ups-usb.rules
SUBSYSTEM==&quot;usb&quot;, ENV{ID_VENDOR_ID}==&quot;051d&quot;, ENV{ID_MODEL_ID}==&quot;0002&quot;, ENV{ID_SERIAL_SHORT}==&quot;4B12P636&quot;, MODE=&quot;0666&quot;, RUN=&quot;/usr/sbin/pct set &amp;lt;lxc-id&amp;gt; --dev0 mode=0666,path=$devnode&quot;
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;If the file is changed, it can be processed with:

&lt;blockquote&gt;&lt;pre&gt;
# reload rules and rerun
udevadm control --reload-rules
udevadm trigger
# optional cable test simulation
udevadm test /dev/bus/usb/003/010
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;The ENV{ID_VENDOR_ID}, ENV{ID_MODEL_ID} &amp;amp; ENV{ID_SERIAL_SHORT} variable names and content can be confirmed with:

&lt;blockquote&gt;&lt;pre&gt;
# udevadm info  /dev/bus/usb/003/010
P: /devices/pci0000:80/0000:80:14.0/usb3/3-4
M: 3-4
R: 4
J: c189:265
U: usb
T: usb_device
D: c 189:265
N: bus/usb/003/010
L: 0
V: usb
E: DEVPATH=/devices/pci0000:80/0000:80:14.0/usb3/3-4
E: DEVNAME=/dev/bus/usb/003/010
E: DEVTYPE=usb_device
E: DRIVER=usb
E: PRODUCT=51d/2/90
E: TYPE=0/0/0
E: BUSNUM=003
E: DEVNUM=010
E: MAJOR=189
E: MINOR=265
E: SUBSYSTEM=usb
E: USEC_INITIALIZED=2435707957355
E: ID_BUS=usb
E: ID_MODEL=Back-UPS_XS_1300G_FW:864.L6_.D_USB_FW:L6
E: ID_MODEL_ENC=Back-UPS\x20XS\x201300G\x20FW:864.L6\x20.D\x20USB\x20FW:L6\x20
E: ID_MODEL_ID=0002
E: ID_SERIAL=American_Power_Conversion_Back-UPS_XS_1300G_FW:864.L6_.D_USB_FW:L6_4B1233P63346
E: ID_SERIAL_SHORT=4B12P636
E: ID_VENDOR=American_Power_Conversion
E: ID_VENDOR_ENC=American\x20Power\x20Conversion
E: ID_VENDOR_ID=051d
E: ID_REVISION=0090
E: ID_USB_MODEL=Back-UPS_XS_1300G_FW:864.L6_.D_USB_FW:L6
E: ID_USB_MODEL_ENC=Back-UPS\x20XS\x201300G\x20FW:864.L6\x20.D\x20USB\x20FW:L6\x20
E: ID_USB_MODEL_ID=0002
E: ID_USB_SERIAL=American_Power_Conversion_Back-UPS_XS_1300G_FW:864.L6_.D_USB_FW:L6_4B1233P63346
E: ID_USB_SERIAL_SHORT=4B12P636
E: ID_USB_VENDOR=American_Power_Conversion
E: ID_USB_VENDOR_ENC=American\x20Power\x20Conversion
E: ID_USB_VENDOR_ID=051d
E: ID_USB_REVISION=0090
E: ID_USB_INTERFACES=:030000:
E: ID_VENDOR_FROM_DATABASE=American Power Conversion
E: ID_MODEL_FROM_DATABASE=Uninterruptible Power Supply
E: ID_PATH_WITH_USB_REVISION=pci-0000:80:14.0-usbv2-0:4
E: ID_PATH=pci-0000:80:14.0-usb-0:4
E: ID_PATH_TAG=pci-0000_80_14_0-usb-0_4
E: ID_FOR_SEAT=usb-pci-0000_80_14_0-usb-0_4
E: TAGS=:seat:
E: CURRENT_TAGS=:seat:
&lt;pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Resources:
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.man7.org/linux/man-pages/man7/udev.7.html&quot; target=_blank&gt;udev(7) — Linux manual page&lt;/a&gt; - Dynamic device management
  &lt;li&gt;&lt;a href=&quot;https://inegm.dev/persistent-names-for-usb-serial-devices-in-linux-dev-ttyusbx-dev-custom-name-fd49b5db9af1&quot; target=_blank&gt;Persistent names for USB-serial devices in Linux (/dev/ttyUSBx -&gt; /dev/custom-name)&lt;/a&gt; - I first looked at doing symlinks, but realized it is not required if I can perform a &#039;pct set&#039; directly on the container configuration.
  &lt;/ul&gt; 
    </content:encoded>

    <pubDate>Sat, 25 Apr 2026 22:07:41 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/1351-guid.html</guid>
    
</item>

</channel>
</rss>
