XRT icon indicating copy to clipboard operation
XRT copied to clipboard

xocl cannot compile on 6.16.10

Open hnws opened this issue 2 months ago • 3 comments

I fully understand that the latest stable kernel might not be on the priority list to support yet. But I believe in two months probably 6.17 or 6.18 would be the next LTS kernel. Is there any plan to support 6.16 at this moment? I want to use 6.16 because amdxdma went into mainline during 6.14 so the current LTS 6.12 does not have this kernel module.

DKMS (dkms-3.2.2) make.log for xrt/2.20.0 for kernel 6.16.10-arch1-1 (x86_64)
Tue Oct  7 10:02:20 EDT 2025

Building module(s)
# command: cd driver/xocl; make KERNEL_SRC=/usr/lib/modules/6.16.10-arch1-1/build; cd ../..
cd userpf; make all
make[1]: Entering directory '/var/lib/dkms/xrt/2.20.0/build/driver/xocl/userpf'
/var/lib/dkms/xrt/2.20.0/build/driver/xocl/userpf
make -C /usr/lib/modules/6.16.10-arch1-1/build M=/var/lib/dkms/xrt/2.20.0/build/driver/xocl/userpf modules
make[2]: Entering directory '/usr/lib/modules/6.16.10-arch1-1/build'
make[3]: Entering directory '/var/lib/dkms/xrt/2.20.0/build/driver/xocl/userpf'
  CC [M]  ../xocl_subdev.o
  CC [M]  ../xocl_ctx.o
  CC [M]  ../xocl_thread.o
  CC [M]  ../xocl_fdt.o
  CC [M]  ../xocl_xclbin.o
  CC [M]  ../xocl_debug.o
  CC [M]  ../xocl_xgq.o
  CC [M]  ../subdev/xdma.o
  CC [M]  ../subdev/qdma.o
  CC [M]  ../subdev/feature_rom.o
../subdev/feature_rom.c:152:17: error: initialization of ‘ssize_t (*)(struct file *, struct kobject *, const struct bin_attribute *, char *, loff_t,  size_t)’
 {aka ‘long int (*)(struct file *, struct kobject *, const struct bin_attribute *, char *, long long int,  long unsigned int)’} from incompatible pointer type
 ‘ssize_t (*)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t,  size_t)’ {aka ‘long int (*)(struct file *, struct kobject *, struct bi
n_attribute *, char *, long long int,  long unsigned int)’} [-Wincompatible-pointer-types]
  152 |         .read = raw_show,
      |                 ^~~~~~~~
../subdev/feature_rom.c:152:17: note: (near initialization for ‘raw_attr.read’)
../subdev/feature_rom.c:130:16: note: ‘raw_show’ declared here
  130 | static ssize_t raw_show(struct file *filp, struct kobject *kobj,
      |                ^~~~~~~~
../subdev/feature_rom.c:164:22: error: initialization of ‘const struct bin_attribute * const*’ from incompatible pointer type ‘struct bin_attribute **’ [-Winc
ompatible-pointer-types]
  164 |         .bin_attrs = rom_bin_attrs,
      |                      ^~~~~~~~~~~~~
../subdev/feature_rom.c:164:22: note: (near initialization for ‘rom_attr_group.<anonymous>.bin_attrs’)
../subdev/feature_rom.c: In function ‘set_vbnv_name’:
../subdev/feature_rom.c:357:53: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint32_t’ {aka ‘unsigned int’} [-
Wformat=]
  357 |         snprintf(sh_version, sizeof(sh_version), "%lx", idcode);
      |                                                   ~~^   ~~~~~~
      |                                                     |   |
      |                                                     |   uint32_t {aka unsigned int}
      |                                                     long unsigned int
      |                                                   %x
make[5]: *** [/usr/lib/modules/6.16.10-arch1-1/build/scripts/Makefile.build:287: ../subdev/feature_rom.o] Error 1
make[4]: *** [/usr/lib/modules/6.16.10-arch1-1/build/Makefile:2003: .] Error 2
make[3]: *** [/usr/lib/modules/6.16.10-arch1-1/build/Makefile:248: __sub-make] Error 2
make[3]: Leaving directory '/var/lib/dkms/xrt/2.20.0/build/driver/xocl/userpf'
make[2]: *** [Makefile:248: __sub-make] Error 2
make[2]: Leaving directory '/usr/lib/modules/6.16.10-arch1-1/build'
make[1]: *** [Makefile:137: all] Error 2
make[1]: Leaving directory '/var/lib/dkms/xrt/2.20.0/build/driver/xocl/userpf'
make: *** [Makefile:2: all] Error 2

# exit code: 0
# elapsed time: 00:00:05

hnws avatar Oct 07 '25 14:10 hnws

It's probably no surprise, but the same failure occurs on 6.17.

$ cat /var/lib/dkms/xrt/2.21.0/build/make.log
DKMS (dkms-3.2.2) make.log for xrt/2.21.0 for kernel 6.17.6+deb14-amd64 (x86_64)
Wed Nov  5 09:39:13 PM CST 2025

Building module(s)
# command: cd driver/xocl; make KERNEL_SRC=/lib/modules/6.17.6+deb14-amd64/build; cd ../..
cd userpf; make all
make[1]: Entering directory '/var/lib/dkms/xrt/2.21.0/build/driver/xocl/userpf'
/var/lib/dkms/xrt/2.21.0/build/driver/xocl/userpf
make -C /lib/modules/6.17.6+deb14-amd64/build M=/var/lib/dkms/xrt/2.21.0/build/driver/xocl/userpf modules
make[2]: Entering directory '/usr/src/linux-headers-6.17.6+deb14-amd64'
make[3]: Entering directory '/var/lib/dkms/xrt/2.21.0/build/driver/xocl/userpf'
  CC [M]  ../xocl_subdev.o
  CC [M]  ../xocl_ctx.o
  CC [M]  ../xocl_thread.o
  CC [M]  ../xocl_fdt.o
  CC [M]  ../xocl_xclbin.o
  CC [M]  ../xocl_debug.o
  CC [M]  ../xocl_xgq.o
  CC [M]  ../subdev/xdma.o
  CC [M]  ../subdev/qdma.o
  CC [M]  ../subdev/feature_rom.o
../subdev/feature_rom.c:152:17: error: initialization of ‘ssize_t (*)(struct file *, struct kobject *, const struct bin_attribute *, char *, loff_t,  size_t)’ {aka ‘long int (*)(struct file *, struct kobject *, const struct bin_attribute *, char *, long long int,  long unsigned int)’} from incompatible pointer type ‘ssize_t (*)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t,  size_t)’ {aka ‘long int (*)(struct file *, struct kobject *, struct bin_attribute *, char *, long long int,  long unsigned int)’} [-Wincompatible-pointer-types]
  152 |         .read = raw_show,
      |                 ^~~~~~~~
../subdev/feature_rom.c:152:17: note: (near initialization for ‘raw_attr.read’)
../subdev/feature_rom.c:130:16: note: ‘raw_show’ declared here
  130 | static ssize_t raw_show(struct file *filp, struct kobject *kobj,
      |                ^~~~~~~~
../subdev/feature_rom.c:164:22: error: initialization of ‘const struct bin_attribute * const*’ from incompatible pointer type ‘struct bin_attribute **’ [-Wincompatible-pointer-types]
  164 |         .bin_attrs = rom_bin_attrs,
      |                      ^~~~~~~~~~~~~
../subdev/feature_rom.c:164:22: note: (near initialization for ‘rom_attr_group.<anonymous>.bin_attrs’)
../subdev/feature_rom.c: In function ‘set_vbnv_name’:
../subdev/feature_rom.c:357:53: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint32_t’ {aka ‘unsigned int’} [-Wformat=]
  357 |         snprintf(sh_version, sizeof(sh_version), "%lx", idcode);
      |                                                   ~~^   ~~~~~~
      |                                                     |   |
      |                                                     |   uint32_t {aka unsigned int}
      |                                                     long unsigned int
      |                                                   %x
make[5]: *** [/usr/src/linux-headers-6.17.6+deb14-common/scripts/Makefile.build:292: ../subdev/feature_rom.o] Error 1
make[4]: *** [/usr/src/linux-headers-6.17.6+deb14-common/Makefile:2035: .] Error 2
make[3]: *** [/usr/src/linux-headers-6.17.6+deb14-common/Makefile:260: __sub-make] Error 2
make[3]: Leaving directory '/var/lib/dkms/xrt/2.21.0/build/driver/xocl/userpf'
make[2]: *** [/usr/src/linux-headers-6.17.6+deb14-common/Makefile:260: __sub-make] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-6.17.6+deb14-amd64'
make[1]: *** [Makefile:137: all] Error 2
make[1]: Leaving directory '/var/lib/dkms/xrt/2.21.0/build/driver/xocl/userpf'
make: *** [Makefile:2: all] Error 2

# exit code: 0
# elapsed time: 00:00:07
----------------------------------------------------------------

superm1 avatar Nov 06 '25 03:11 superm1

I want to use 6.16 because amdxdma went into mainline during 6.14 so the current LTS 6.12 does not have this kernel module.

JFYI - you don't need xocl for amdxdna. You need amdxdna. They're for supporting different products/needs. IIRC amdxdna can't work on 6.12, it needs IOMMU changes that came in 6.13/6.14.

superm1 avatar Nov 06 '25 06:11 superm1

@superm1 The unconditional addition of const breaks backwards compatibility with older kernels, e.g. Linux 6.12 in Debian stable (probably everything < 6.16). Given the huge amount of LINUX_VERSION_CODE and KERNEL_VERSION() in the source I don't think that is intended.

anbe42 avatar Nov 23 '25 02:11 anbe42