{"id":1306,"date":"2025-04-20T00:42:20","date_gmt":"2025-04-19T22:42:20","guid":{"rendered":"https:\/\/daisy-street.fr\/?p=1306"},"modified":"2025-05-21T00:24:51","modified_gmt":"2025-05-20T22:24:51","slug":"step-by-step-nvidia-driver-installation-for-proxmox-users","status":"publish","type":"post","link":"https:\/\/daisy-street.fr\/index.php\/2025\/04\/20\/step-by-step-nvidia-driver-installation-for-proxmox-users\/","title":{"rendered":"Step-by-Step NVIDIA Driver Installation for Proxmox Users"},"content":{"rendered":"\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h3 class=\"wp-block-heading\"><strong>Use GPU in a VM (Passthrough only)<\/strong><\/h3>\n\n\n\n<p>If you&#8217;re intentionally passing the GPU to a VM (e.g. Windows or Linux VM with GPU acceleration), then:<\/p>\n\n\n\n<p>You <strong>should not<\/strong> install the NVIDIA driver on the <strong>Proxmox host<\/strong>.<\/p>\n\n\n\n<p>Instead, install it <strong>inside the VM<\/strong>, and keep <code>vfio-pci<\/code> bound on the host.<\/p>\n\n\n\n<p><strong>Use GPU on the Proxmox Host or in LXC<\/strong><\/p>\n<\/div><\/div>\n\n\n\n<p>Start by find the correct NVIDIA driver<\/p>\n\n\n\n<p><a href=\"https:\/\/www.nvidia.com\/en-us\/drivers\">https:\/\/www.nvidia.com\/en-us\/drivers<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">On the proxmox host :<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\nsudo apt update\nsudo apt install pve-headers-$(uname -r) build-essential dkms\n\nwget https:\/\/us.download.nvidia.com\/XFree86\/Linux-x86_64\/570.144\/NVIDIA-Linux-x86_64-570.144.run\nchmod +x .\/NVIDIA-Linux-x86_64-570.144.run\n\n.\/NVIDIA-Linux-x86_64-570.144.run\nsudo .\/NVIDIA-Linux-x86_64-570.144.run -dkms\n\nnvidia-smi\nnano \/etc\/modules-load.d\/modules.conf<\/code><\/pre>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>nvidia\nnvidia_uvm<\/code><\/pre><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -al \/dev\/nvidia*<\/code><\/pre>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>root@pve:~# ls -al \/dev\/nvidia*\ncrw-rw-rw- 1 root root 195,   0 Apr 29 08:21 \/dev\/nvidia0\ncrw-rw-rw- 1 root root 195, 255 Apr 29 08:21 \/dev\/nvidiactl\ncrw-rw-rw- 1 root root 511,   0 Apr 29 08:21 \/dev\/nvidia-uvm\ncrw-rw-rw- 1 root root 511,   1 Apr 29 08:21 \/dev\/nvidia-uvm-tools\n\n\/dev\/nvidia-caps:\ntotal 0\ndrwxr-xr-x  2 root root     80 Apr 29 08:21 .\ndrwxr-xr-x 20 root root   4800 Apr 29 08:21 ..\ncr--------  1 root root 236, 1 Apr 29 08:21 nvidia-cap1\ncr--r--r--  1 root root 236, 2 Apr 29 08:21 nvidia-cap2<\/code><\/pre><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/pve\/lxc\/115.conf <sup data-fn=\"1b4f1f8b-40d3-48b2-981f-75eb9dcecda9\" class=\"fn\"><a href=\"#1b4f1f8b-40d3-48b2-981f-75eb9dcecda9\" id=\"1b4f1f8b-40d3-48b2-981f-75eb9dcecda9-link\">1<\/a><\/sup><\/code><\/pre>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>lxc.cgroup2.devices.allow: c 195:* rwm\nlxc.cgroup2.devices.allow: c 236:* rwm\nlxc.cgroup2.devices.allow: c 511:* rwm\nlxc.mount.entry: \/dev\/nvidia0 dev\/nvidia0 none bind,optional,create=file\nlxc.mount.entry: \/dev\/nvidiactl dev\/nvidiactl none bind,optional,create=file\nlxc.mount.entry: \/dev\/nvidia-caps dev\/nvidia-caps none bind,optional,create=file\nlxc.mount.entry: \/dev\/nvidia-uvm dev\/nvidia-uvm none bind,optional,create=file\nlxc.mount.entry: \/dev\/nvidia-uvm-tools dev\/nvidia-uvm-tools none bind,optional,create=file<\/code><\/pre><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>pct push 115 .\/NVIDIA-Linux-x86_64-570.144.run \/root\/NVIDIA-Linux-x86_64-570.144.run<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">On Lxc :<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>sh NVIDIA-Linux-x86_64-570.144.run  --no-kernel-module\nnvidia-smi<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">For Docker:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># Add Nvidia repository key\napt install -y gpg\ncurl -fsSL https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/debian12\/x86_64\/3bf863cc.pub | gpg --dearmor -o \/etc\/apt\/keyrings\/nvidia-archive-keyring.gpg\n\n# Add Nvidia repository\necho \"deb &#91;signed-by=\/etc\/apt\/keyrings\/nvidia-archive-keyring.gpg] https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/debian12\/x86_64\/ \/\" | tee \/etc\/apt\/sources.list.d\/nvidia-cuda-debian12.list\n\n# Update package lists\napt update\n\n# Install Nvidia container toolkit\napt install nvidia-container-toolkit\n\nnano \/etc\/docker\/daemon.json<\/code><\/pre>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>{\n  &quot;default-runtime&quot;: &quot;nvidia&quot;,\n  &quot;runtimes&quot;: {\n  &quot;nvidia&quot;: {\n    &quot;path&quot;: &quot;nvidia-container-runtime&quot;,\n    &quot;runtimeArgs&quot;: []\n  }\n  }\n}<\/code><\/pre><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nvidia-ctk runtime configure --runtime=docker<\/code><\/pre>\n\n\n\n<p>nano \/etc\/nvidia-container-runtime\/config.toml<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code># Set no-cgroups to true\nno-cgroups = true<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">For testing<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># Run a test Docker container to verify GPU usage\ndocker run --gpus all nvidia\/cuda:12.6.1-base-ubuntu24.04 nvidia-smi<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" data-attachment-id=\"1313\" data-permalink=\"https:\/\/daisy-street.fr\/index.php\/2025\/04\/20\/step-by-step-nvidia-driver-installation-for-proxmox-users\/image-32\/\" data-orig-file=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2025\/04\/image.png\" data-orig-size=\"1208,644\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2025\/04\/image-300x160.png\" data-large-file=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2025\/04\/image-1024x546.png\" src=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2025\/04\/image-1024x546.png\" alt=\"\" class=\"wp-image-1313\" srcset=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2025\/04\/image-1024x546.png 1024w, https:\/\/daisy-street.fr\/wp-content\/uploads\/2025\/04\/image-300x160.png 300w, https:\/\/daisy-street.fr\/wp-content\/uploads\/2025\/04\/image-768x409.png 768w, https:\/\/daisy-street.fr\/wp-content\/uploads\/2025\/04\/image.png 1208w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">If needed before purge old nvidia driver<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt remove --purge '^nvidia-.*'\nsudo apt autoremove<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Source : <\/p>\n\n\n\n<p><a href=\"https:\/\/yomis.blog\/nvidia-gpu-in-proxmox-lxc\">https:\/\/yomis.blog\/nvidia-gpu-in-proxmox-lxc<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/hostbor.com\/gpu-passthrough-in-lxc-containers\">https:\/\/hostbor.com\/gpu-passthrough-in-lxc-containers<\/a><\/p>\n<\/blockquote>\n\n\n\n<p><\/p>\n\n\n<ol class=\"wp-block-footnotes\"><li id=\"1b4f1f8b-40d3-48b2-981f-75eb9dcecda9\">Be aware that one time the cgroup2 number as change after a full reboot (510->511)  <a href=\"#1b4f1f8b-40d3-48b2-981f-75eb9dcecda9-link\" aria-label=\"Jump to footnote reference 1\">\u21a9\ufe0e<\/a><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>Use GPU in a VM (Passthrough only) If you&#8217;re intentionally passing the GPU to a VM (e.g. Windows or Linux VM with GPU acceleration), then: You should not install the NVIDIA driver on the Proxmox host. Instead, install it inside the VM, and keep vfio-pci bound on the host. Use GPU on the Proxmox Host &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/daisy-street.fr\/index.php\/2025\/04\/20\/step-by-step-nvidia-driver-installation-for-proxmox-users\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Step-by-Step NVIDIA Driver Installation for Proxmox Users&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"[{\"content\":\"Be aware that one time the cgroup2 number as change after a full reboot (510->511) \",\"id\":\"1b4f1f8b-40d3-48b2-981f-75eb9dcecda9\"}]","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[12],"tags":[20,68,160,14],"class_list":["post-1306","post","type-post","status-publish","format-standard","hentry","category-software","tag-docker","tag-gpu","tag-nvidia","tag-proxmox"],"jetpack_publicize_connections":[],"featured_image_src":null,"author_info":{"display_name":"admin9483","author_link":"https:\/\/daisy-street.fr\/index.php\/author\/admin9483\/"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/1306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/comments?post=1306"}],"version-history":[{"count":12,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/1306\/revisions"}],"predecessor-version":[{"id":1350,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/1306\/revisions\/1350"}],"wp:attachment":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/media?parent=1306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/categories?post=1306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/tags?post=1306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}