Gds-nvidia-fs build error

Hi

I’m getting the following error while installing Nvidia Direct Storage. This is using Ubuntu 20.04. CUDA 11.1 and Driver 460.80.

Following the steps mentioned here: NVIDIA GPUDirect Storage Installation and Troubleshooting Guide :: NVIDIA GPUDirect Storage Documentation

Picking NVIDIA driver sources from NVIDIA_SRC_DIR=/usr/src/nvidia-460.80/nvidia. If that does not meet your expectation, you might have a stale driver still around and that might cause problems.
Getting symbol versions from /lib/modules/5.8.0-55-generic/updates/dkms/nvidia.ko ...
Created: /home/user1/ds/gds-nvidia-fs/src/nv.symvers
checking if uaccess.h access_ok has 3 parameters... no
checking if uaccess.h access_ok has 2 parameters... yes
Checking if blkdev.h has blk_rq_payload_bytes... yes
Checking if fs.h has call_read_iter and call_write_iter... yes
Checking if fs.h has filemap_range_has_page... yes
Checking if kiocb structue has ki_complete field... yes
Checking if vm_fault_t exist in mm_types.h... yes
Checking if IOCB_HIPRI flag exists in fs.h... yes
Checking if enum PCIE_SPEED_32_0GT exists in pci.h... yes
make[1]: Entering directory '/usr/src/linux-headers-5.8.0-55-generic'
  CC [M]  /home/user1/ds/gds-nvidia-fs/src//nvfs-core.o
  CC [M]  /home/user1/ds/gds-nvidia-fs/src//nvfs-dma.o
  CC [M]  /home/user1/ds/gds-nvidia-fs/src//nvfs-mmap.o
  CC [M]  /home/user1/ds/gds-nvidia-fs/src//nvfs-pci.o
In file included from ./include/linux/string.h:6,
                 from ./include/linux/dma-mapping.h:6,
                 from /home/user1/ds/gds-nvidia-fs/src//nvfs-dma.c:24:
/home/user1/ds/gds-nvidia-fs/src//nvfs-dma.c: In function ‘nvfs_blk_rq_check’:
/home/user1/ds/gds-nvidia-fs/src//nvfs-dma.c:189:73: error: ‘RQF_COPY_USER’ undeclared (first use in this function)
  189 |  if (unlikely((req->rq_flags & RQF_SPECIAL_PAYLOAD) || (req->rq_flags & RQF_COPY_USER)))
      |                                                                         ^~~~~~~~~~~~~
./include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
/home/user1/ds/gds-nvidia-fs/src//nvfs-dma.c:189:73: note: each undeclared identifier is reported only once for each function it appears in
  189 |  if (unlikely((req->rq_flags & RQF_SPECIAL_PAYLOAD) || (req->rq_flags & RQF_COPY_USER)))
      |                                                                         ^~~~~~~~~~~~~
./include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
/home/user1/ds/gds-nvidia-fs/src//nvfs-dma.c: In function ‘nvfs_blk_rq_map_sg_internal’:
/home/user1/ds/gds-nvidia-fs/src//nvfs-dma.c:335:18: error: ‘struct request_queue’ has no member named ‘dma_drain_size’
  335 |    if (unlikely(q->dma_drain_size && q->dma_drain_needed(req))) {
      |                  ^~
./include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
/home/user1/ds/gds-nvidia-fs/src//nvfs-dma.c:335:39: error: ‘struct request_queue’ has no member named ‘dma_drain_needed’
  335 |    if (unlikely(q->dma_drain_size && q->dma_drain_needed(req))) {
      |                                       ^~
./include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
make[2]: *** [scripts/Makefile.build:286: /home/user1/ds/gds-nvidia-fs/src//nvfs-dma.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1785: /home/user1/ds/gds-nvidia-fs/src/] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.8.0-55-generic'
make: *** [Makefile:109: module] Error 2

Regards,
MJay

Your kernel appears to be “too new”, see here

so the new version of the kernel is not supported for now.

Any workaround solution for this?

Regards,
MJay

Use an older kernel?

Which kernel version is giving trouble while compiling?

presumably: