{"id":3400,"date":"2025-12-29T00:20:31","date_gmt":"2025-12-29T08:20:31","guid":{"rendered":"https:\/\/rglinuxtech.com\/?p=3400"},"modified":"2025-12-29T00:20:31","modified_gmt":"2025-12-29T08:20:31","slug":"nvidia-nasty-hack-time-again-for-gtx-gpus-with-kernel-6-19","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=3400","title":{"rendered":"NVIDIA &#8211; Nasty Hack Time Again &#8211; for GTX GPUs with Kernel 6.19&#8230;.."},"content":{"rendered":"<p>This is a summary of the changes I made to the NVIDIA proprietary &#8216;kernel&#8217; code to get driver<strong> 580.119.02<\/strong> working with Kernel <strong>6.19-rc3<\/strong>..<br \/>\n<em><strong>This is a hack, and is not made by a professional, so use at your own risk, and do not use in a business-critical environment!<\/strong><\/em><\/p>\n<p>As mentioned in the previous article, I have tested this with Fedora 43 KDE\/Plasma running VMware Workstation 25.0.0 with a Win10 Guest, and all seems to work as it should&#8230; These changes do not include complete kernel version tests, so the resulting driver is only for the 6.19.x kernel, but does support the older GTX GPUs&#8230; Some of the initial changes are similar to those for the &#8216;kernel-open&#8217; code..<\/p>\n<p>I found a suitable patch for the GPL issue &#8211; dating back to kernel 6.15, at:<br \/>\n<a href=\"https:\/\/github.com\/CachyOS\/CachyOS-PKGBUILDS\/commit\/b85953540b1b6ee604060870d45a0da8ab3e0487\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/CachyOS\/CachyOS-PKGBUILDS\/commit\/b85953540b1b6ee604060870d45a0da8ab3e0487<\/a><\/p>\n<p>and incorporated that with the following code changes..<\/p>\n<p><span style=\"font-family: Georgia, Times, serif; font-size: 20px;\"><strong>~\/kernel\/common\/inc\/nv-mm.h<\/strong><\/span><br \/>\naround line 204:<br \/>\n<em>This already includes the &#8216;correct&#8217; code, but the obscure test around it now fails, exposing the &#8216;incorrect&#8217; code, so remove it, leaving the correct code only..<\/em><br \/>\nRemove<br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">#if !NV_CAN_CALL_VMA_START_WRITE<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">\u00a0nv_vma_start_write(vma);<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">\u00a0ACCESS_PRIVATE(vma, __vm_flags) |= flags;<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">#elif defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS)<\/span><\/strong><br \/>\nand<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#else<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>\u00a0vma-&gt;vm_flags |= flags;<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#endif<\/strong><\/span><br \/>\nleaving just<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>vm_flags_set(vma, flags);<\/strong><\/span><\/p>\n<p>&#8211; and do the same to the next (similar) code, leaving just<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>vm_flags_clear(vma, flags);<\/strong><\/span><\/p>\n<p><span style=\"font-size: 20px;\"><strong>~\/kernel\/nvidia\/nv-dma.c<\/strong><\/span><br \/>\naround line 718:<br \/>\nchange:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>return (ops-&gt;map_resource != NULL);<\/strong><\/span><br \/>\nto:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>return NV_TRUE;<\/strong><\/span><\/p>\n<p><span style=\"font-size: 20px;\"><strong>~\/kernel\/nvidia\/nv-mmap.c<br \/>\n<\/strong><\/span>around line 20,add:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#include &lt;linux\/version.h&gt;<br \/>\n<\/strong><\/span><\/p>\n<p>and after the #include,s, add:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#if LINUX_VERSION_CODE &gt;= KERNEL_VERSION(6, 19, 0)<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)-&gt;vm_flags | (f))<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)-&gt;vm_flags &amp; ~(f))<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#endif<\/strong><\/span><\/p>\n<p><span style=\"font-size: 20px;\"><strong>~\/kernel\/nvidia-drm\/nvidia-drm-gem.c<\/strong><\/span><\/p>\n<p>around line 45, add:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#include &lt;linux\/version.h&gt;<\/strong><\/span><\/p>\n<p><strong><span style=\"font-family: Courier New, Courier, monospace;\">#if LINUX_VERSION_CODE &gt;= KERNEL_VERSION(6, 19, 0)<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)-&gt;vm_flags | (f))<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)-&gt;vm_flags &amp; ~(f))<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">#endif<\/span><\/strong><\/p>\n<p><span style=\"font-size: 20px;\"><strong>~\/kernel\/nvidia-drm\/nvidia-drm-gem-user-memory.c<\/strong><\/span><\/p>\n<p>around line 42, after the #endif, add:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#include &lt;linux\/version.h&gt;<\/strong><\/span><\/p>\n<p><span style=\"font-family: Courier New, Courier, monospace;\"><strong>#if LINUX_VERSION_CODE &gt;= KERNEL_VERSION(6, 19, 0)<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)-&gt;vm_flags | (f))<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)-&gt;vm_flags &amp; ~(f))<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#endif<\/strong><\/span><\/p>\n<p><span style=\"font-size: 20px;\"><strong>~\/kernel\/nvidia-uvm\/uvm.c<\/strong><\/span><\/p>\n<p>around line 22, add:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>#include &lt;linux\/version.h&gt;<\/strong><\/span><\/p>\n<p>around line 43, add:<br \/>\n<span style=\"font-size: 16px; font-family: Courier New, Courier, monospace;\"><strong>#if LINUX_VERSION_CODE &gt;= KERNEL_VERSION(6, 19, 0)<\/strong><\/span><br \/>\n<span style=\"font-size: 16px; font-family: Courier New, Courier, monospace;\"><strong>#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)-&gt;vm_flags | (f))<\/strong><\/span><br \/>\n<span style=\"font-size: 16px; font-family: Courier New, Courier, monospace;\"><strong>#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)-&gt;vm_flags &amp; ~(f))<\/strong><\/span><br \/>\n<span style=\"font-size: 16px; font-family: Courier New, Courier, monospace;\"><strong>#endif<\/strong><\/span><\/p>\n<p>The result:<br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>&#8230;&#8230;&#8230;<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>CC [M] nvidia.mod.o<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>CC [M] .module-common.o<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>LD [M] nvidia.ko<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>CC [M] nvidia-uvm.mod.o<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>LD [M] nvidia-uvm.ko<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>CC [M] nvidia-modeset.mod.o<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>LD [M] nvidia-modeset.ko<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>CC [M] nvidia-drm.mod.o<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>LD [M] nvidia-drm.ko<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>CC [M] nvidia-peermem.mod.o<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>LD [M] nvidia-peermem.ko<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>make[2]: Leaving directory &#8216;\/home\/rgadsdon\/NVIDIA-Linux-x86_64-580.119.02-custom\/kernel&#8217;<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>make[1]: Leaving directory &#8216;\/usr\/src\/linux-6.19-rc3&#8217;<\/strong><\/span><\/p>\n<p>and:<\/p>\n<p><strong><span style=\"font-family: Courier New, Courier, monospace;\"># uname -a<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Linux rgxeonl 6.19.0-rc3 #1 SMP PREEMPT_DYNAMIC Sun Dec 28 16:41:08 PST 2025 x86_64 GNU\/Linux<\/span><\/strong><br \/>\n<code><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong># nvidia-smi<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>Sun Dec 28 17:28:34 2025<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>+-----------------------------------------------------------------------------------------+<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>| NVIDIA-SMI 580.119.02 Driver Version: 580.119.02 CUDA Version: 13.0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>+-----------------------------------------+------------------------+----------------------+<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>| GPU Name Persistence-M\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | Bus-Id Disp.A\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | Volatile Uncorr. ECC |<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>| Fan Temp Perf Pwr:Usage\/Cap\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| Memory-Usage\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| GPU-Util Compute M.\u00a0 |<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>|\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | MIG M.\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>|=========================================+========================+======================|<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>| 0 NVIDIA GeForce GTX 1050 Ti Off\u00a0 \u00a0 \u00a0 \u00a0 | 00000000:03:00.0 On\u00a0 \u00a0 | N\/A\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 |<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>| 46% 32C P0 N\/A \/ 75W\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | 15MiB \/ 4096MiB\u00a0 \u00a0 \u00a0 \u00a0 | 0% Default\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>|\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | N\/A\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 |<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>+-----------------------------------------+------------------------+----------------------+<\/strong><\/span><br \/>\n<\/code><br \/>\nAs before, this is an unsophisticated hack, so hopefully someone who really knows what they are doing can produce a &#8216;proper&#8217; patch!<\/p>\n<p><em><strong>Robert Gadsdon. December 28th 2025.<\/strong><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a summary of the changes I made to the NVIDIA proprietary &#8216;kernel&#8217; code to get driver 580.119.02 working with Kernel 6.19-rc3.. This is a hack, and is not made by a professional, so use at your own risk, and do not use in a business-critical environment! As mentioned in the previous article, I have tested <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=3400\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[5,11,14,15,18,19],"tags":[2791,2800,182,2801,277],"class_list":["post-3400","post","type-post","status-publish","format-standard","hentry","category-compilation","category-hacks","category-kernel","category-linux-2","category-nvidia","category-opinion","tag-580-119-02","tag-gtx-gpus","tag-hack","tag-kernel-6-19-support","tag-nvidia-2"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/3400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3400"}],"version-history":[{"count":3,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/3400\/revisions"}],"predecessor-version":[{"id":3403,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/3400\/revisions\/3403"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}