Modpost: "nvidia_p2p_get_pages" .. undefined

Hi,

My setup:
Ubuntu 20.04
Kernel 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Nvidia drivers: nvidia-510.47.03
Cuda toolkit 11.6
I’m trying to build drivers for a KAYA frame grabber, and it fails with the following mesage:

ERROR: modpost: "nvidia_p2p_get_pages" [/home/myuser/Desktop/KAYA/KAYA_Vision_Point_Setup_2022.1_Ubuntu_20.04_x64__branches-sw_6_1_x_2022_1_build_6.1.0.8456_2022-04-17_21-03-13/PCI_drv_Linux/predator_driver.ko] undefined!

I saw several posts on the web where developers had a similar problems, but no solutions offered.
Can you please assist resolve the issue?

Thanks @Robert_Crovella .

The files you mentioned in the drivers ‘kernel’ directory (NVIDIA-Linux-x86_64-510.47.03/kernel) are already available in /usr/src/nvidia-510.47.03/ on my machine (probably part of the driver / toolkit installation).

When the frame grabber build script adds /usr/src/nvidia-510.47.03/ to the include path:

/home/hpa_lara_gb/Desktop/KAYA/KAYA_Vision_Point_Setup_2022.1_Ubuntu_20.04_x64__branches-sw_6_1_x_2022_1_build_6.1.0.8456_2022-04-17_21-03-13/PCI_drv_Linux/aclpci_dma.c:76:9: note: #pragma message: Building with NV_BUILD_DGPU
   76 | #pragma message("Building with NV_BUILD_DGPU")

Which means it includes <nv-p2p.h> succesfully (predator_driver.o is genrated).

#if (KAYA_CUDA_BUILD > 0)
#if (KAYA_CUDA_BUILD == KAYA_CUDA_DGPU)
#pragma message("Building with NV_BUILD_DGPU")
#include <nv-p2p.h>
#else
#pragma message("Building without NV_BUILD_DGPU")
#endif
#endif // #if (KAYA_CUDA_BUILD > 0)

Does the driver have to dynamically link with some nvidia shared object?

Have you checked with KAYA ? I personally have no experience building KAYA things. It looks to me like nvidia_p2p_get_pages is exported as a symbol by our driver.

Thanks @Robert_Crovella ,

I contacted KAYA, but you guys responded faster.
I followed your advice, as well as GPUDirect RDMA :: CUDA Toolkit Documentation (nvidia.com), compiled nvidia.ko, and added this line to the KAYA Makefile.

KBUILD_EXTRA_SYMBOLS := $NVIDIA_SRC_DIR/Module.symvers

The message about nvidia_p2p_get_pages still appears, but it’s a wraning, and the predator_driver.ko is generated:

WARNING: modpost: "nvidia_p2p_get_pages" [/home/hpa_lara_gb/Desktop/KAYA/KAYA_Vision_Point_Setup_2022.1_Ubuntu_20.04_x64__br456_2022-04-17_21-03-13/PCI_drv_Linux/predator_driver.ko] undefined!