NVIDIA / gdrcopy

A fast GPU memory copy library based on NVIDIA GPUDirect RDMA technology
MIT License
898 stars 144 forks source link

Does not compile on RHEL 9.5 #309

Open bsteinb opened 1 week ago

bsteinb commented 1 week ago

The kernel in RHEL 9.5 comes with a backport of https://github.com/torvalds/linux/commit/bc292ab00f6c7a661a8a605c714e8a148f629ef6 which means mm.h now defines vm_flags_set. However, the version check in gdrdrv.c does not catch this, as the RHEL 9.5 kernel identifies as 5.14.0. Building gdrcopy thus fails with:

  CC [M]  /builddir/build/BUILD/gdrcopy-2.4.1/src/gdrdrv/gdrdrv.o
/builddir/build/BUILD/gdrcopy-2.4.1/src/gdrdrv/gdrdrv.c:102:20: error: redefinition of 'vm_flags_set'
  102 | static inline void vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags)
      |                    ^~~~~~~~~~~~
In file included from /builddir/build/BUILD/gdrcopy-2.4.1/src/gdrdrv/gdrdrv.c:34:
./include/linux/mm.h:826:20: note: previous definition of 'vm_flags_set' with type 'void(struct vm_area_struct *, vm_flags_t)' {aka 'void(struct vm_area_struct *, long unsigned int)'}
  826 | static inline void vm_flags_set(struct vm_area_struct *vma,
      |                    ^~~~~~~~~~~~
/builddir/build/BUILD/gdrcopy-2.4.1/src/gdrdrv/gdrdrv.c: In function 'vm_flags_set':
/builddir/build/BUILD/gdrcopy-2.4.1/src/gdrdrv/gdrdrv.c:104:19: error: assignment of read-only member 'vm_flags'
  104 |     vma->vm_flags |= flags;
      |                   ^~
make[3]: *** [scripts/Makefile.build:249: /builddir/build/BUILD/gdrcopy-2.4.1/src/gdrdrv/gdrdrv.o] Error 1