staralt / dxgkrnl-dkms

GPU-P (dxgkrnl) on Hyper-V Linux VM with Latest Kernel
GNU General Public License v2.0
21 stars 4 forks source link

Can support be provided for truenas scale? #2

Closed yijiangchengming closed 3 months ago

yijiangchengming commented 3 months ago

TrueNAS is an open source network storage system on which I run my workloads, using the latest TrueNAS SCALE 23.10.2 version. It now has a 6.6 kernel, but I don't know what to do with it. https://github.com/truenas/linux.git Provide the command install-dev-tools to enable developer mode and make it writable. Download the install.sh script and run it locally, delete linux-header-(uname -a). Then run it, but the following error occurs

Consult /var/lib/dkms/dxgkrnl/149cbd13f/build/make.log for more information.
DKMS make.log for dxgkrnl-149cbd13f for kernel 6.6.44-production+truenas (x86_64)
Tue Aug 20 06:08:20 CST 2024
make: Entering directory '/usr/src/linux-headers-6.6.44-production+truenas'
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/dxgkrnl/149cbd13f/build/dxgmodule.o] Killed
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/dxgkrnl/149cbd13f/build/hmgr.o] Killed
make[1]: *** [/usr/src/linux-headers-6.6.44-production+truenas/Makefile:1924: /var/lib/dkms/dxgkrnl/149cbd13f/build] Error 2
make: *** [Makefile:237: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas
staralt commented 3 months ago

I'm interested in this problem. It also occurred while cross-compiling via my Debian systems.

I found that the TrueNAS 6.6 Linux kernel has an old eventfd_signal function even though it is the latest version.

Perhaps the 0002-Fix-eventfd_signal patch is causing this problem. Excluding this patch fixed the issue.

install.sh:

        "linux-msft-wsl-6.6.y")
            PATCHES="linux-msft-wsl-5.15.y/0001-Add-a-gpu-pv-support.patch”;
#                    linux-msft-wsl-6.6.y/0002-Fix-eventfd_signal.patch"; <———— comment out here

            for PATCH in $PATCHES; do

Did this fix the issue on your system?


make.log:

DKMS make.log for dxgkrnl-149cbd13f for kernel 6.6.32-production+truenas (x86_64) 
Tue Aug 20 14:36:28 UTC 2024 
make: Entering directory '/usr/src/linux-headers-6.6.32-production+truenas' 
  CC [M]  /var/lib/dkms/dxgkrnl/149cbd13f/build/dxgmodule.o 
  CC [M]  /var/lib/dkms/dxgkrnl/149cbd13f/build/hmgr.o 
  CC [M]  /var/lib/dkms/dxgkrnl/149cbd13f/build/misc.o 
  CC [M]  /var/lib/dkms/dxgkrnl/149cbd13f/build/dxgadapter.o 
  CC [M]  /var/lib/dkms/dxgkrnl/149cbd13f/build/ioctl.o 
  CC [M]  /var/lib/dkms/dxgkrnl/149cbd13f/build/dxgvmbus.o 
/var/lib/dkms/dxgkrnl/149cbd13f/build/dxgmodule.c: In function 'signal_host_cpu_event': 
/var/lib/dkms/dxgkrnl/149cbd13f/build/dxgmodule.c:195:17: error: too few arguments to function 'eventfd_signal' 
  195 |                 eventfd_signal(event->cpu_event); 
      |                 ^~~~~~~~~~~~~~ 
In file included from /var/lib/dkms/dxgkrnl/149cbd13f/build/dxgmodule.c:15: 
./include/linux/eventfd.h:38:7: note: declared here 
   38 | __u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n); 
      |       ^~~~~~~~~~~~~~ 
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/dxgkrnl/149cbd13f/build/dxgmodule.o] Error 1 
make[2]: *** Waiting for unfinished jobs.... 
make[1]: *** [/usr/src/linux-headers-6.6.32-production+truenas/Makefile:1916: /var/lib/dkms/dxgkrnl/149cbd13f/build] Error 2 
make: *** [Makefile:237: __sub-make] Error 2 
make: Leaving directory '/usr/src/linux-headers-6.6.32-production+truenas'
yijiangchengming commented 3 months ago

I commented it out, but have the same error.

DKMS make.log for dxgkrnl-149cbd13f for kernel 6.6.44-production+truenas (x86_64)
Wed Aug 21 18:45:40 CST 2024
make: Entering directory '/usr/src/linux-headers-6.6.44-production+truenas'
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/dxgkrnl/149cbd13f/build/dxgmodule.o] Killed
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/dxgkrnl/149cbd13f/build/hmgr.o] Killed
make[1]: *** [/usr/src/linux-headers-6.6.44-production+truenas/Makefile:1924: /var/lib/dkms/dxgkrnl/149cbd13f/build] Error 2
make: *** [Makefile:237: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas'
staralt commented 3 months ago

I commented it out, but have the same error.

DKMS make.log for dxgkrnl-149cbd13f for kernel 6.6.44-production+truenas (x86_64)
Wed Aug 21 18:45:40 CST 2024
make: Entering directory '/usr/src/linux-headers-6.6.44-production+truenas'
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/dxgkrnl/149cbd13f/build/dxgmodule.o] Killed
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/dxgkrnl/149cbd13f/build/hmgr.o] Killed
make[1]: *** [/usr/src/linux-headers-6.6.44-production+truenas/Makefile:1924: /var/lib/dkms/dxgkrnl/149cbd13f/build] Error 2
make: *** [Makefile:237: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas'

Uh oh, I keep looking into this issue.

Is the libelf-dev package installed on your system?

yijiangchengming commented 3 months ago

我将其注释掉,但仍然出现同样的错误。

DKMS make.log for dxgkrnl-149cbd13f for kernel 6.6.44-production+truenas (x86_64)
Wed Aug 21 18:45:40 CST 2024
make: Entering directory '/usr/src/linux-headers-6.6.44-production+truenas'
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/dxgkrnl/149cbd13f/build/dxgmodule.o] Killed
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/dxgkrnl/149cbd13f/build/hmgr.o] Killed
make[1]: *** [/usr/src/linux-headers-6.6.44-production+truenas/Makefile:1924: /var/lib/dkms/dxgkrnl/149cbd13f/build] Error 2
make: *** [Makefile:237: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas'

哦哦,我一直在研究这个问题。

该软件包是否libelf-dev安装在您的系统上?

Not installed, but after installation, the same error message still appears

staralt commented 3 months ago

Please, check the following dependencies are installed:

build-essential flex bison dwarves libssl-dev libelf-dev
yijiangchengming commented 3 months ago

I noticed that you updated the script and now it is installed successfully.

staralt commented 3 months ago

I noticed that you updated the script and now it is installed successfully.

Oh, really? Is the script install.sh@9e7527a working for you completely?

yijiangchengming commented 3 months ago

I noticed that you updated the script and now it is installed successfully.

Oh, really? Is the script install.sh@9e7527a working for you completely?

Yes, it works very well.There may be some minor issues with system version determination. Below is its /etc/os-release file.

root@truenas[/mnt/data]# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

And it does not require additional installation of linux-header, because it is already installed by default.The naming method of linux-header seems to be different from that of the ordinary version.

linux-headers-truenas-debug-amd64/now 6.6.44-debug+truenas-1 amd64 [installed,local]
  Linux kernel headers for 6.6.44-debug+truenas on amd64

linux-headers-truenas-production-amd64/now 6.6.44-production+truenas-1 amd64 [installed,local]
  Linux kernel headers for 6.6.44-production+truenas on amd64
staralt commented 3 months ago

I noticed that you updated the script and now it is installed successfully.

Oh, really? Is the script install.sh@9e7527a working for you completely?

Yes, it works very well.There may be some minor issues with system version determination. Below is its /etc/os-release file.

root@truenas[/mnt/data]# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

And it does not require additional installation of linux-header, because it is already installed by default.The naming method of linux-header seems to be different from that of the ordinary version.

linux-headers-truenas-debug-amd64/now 6.6.44-debug+truenas-1 amd64 [installed,local]
  Linux kernel headers for 6.6.44-debug+truenas on amd64

linux-headers-truenas-production-amd64/now 6.6.44-production+truenas-1 amd64 [installed,local]
  Linux kernel headers for 6.6.44-production+truenas on amd64

Ok, I’ll fix the additional issues. Thank you for your support

staralt commented 3 months ago

Could you please confirm that the changes of install.sh are working?

curl -fsSL https://content.staralt.dev/dxgkrnl-dkms/staralt/issue2/install.sh | sudo bash -es
yijiangchengming commented 3 months ago
# linux-msft-wsl-6.6.y/0002-Fix-eventfd_signal.patch"; <———— comment

After commenting this line,it works.

staralt commented 3 months ago
# linux-msft-wsl-6.6.y/0002-Fix-eventfd_signal.patch"; <———— comment

After commenting this line,it works.

Ohhh, I missed that commenting out there is required for TrueNAS kernel.

staralt commented 3 months ago
# linux-msft-wsl-6.6.y/0002-Fix-eventfd_signal.patch"; <———— comment

After commenting this line,it works.

Will the updated script work without any edits?

yijiangchengming commented 3 months ago
# linux-msft-wsl-6.6.y/0002-Fix-eventfd_signal.patch"; <———— comment

After commenting this line,it works.

Will the updated script work without any edits?

Yes, no additional editing is required.