# Modpost: "nvidia\_p2p\_get\_pages" .. undefined

**URL:** <https://forums.developer.nvidia.com/t/modpost-nvidia-p2p-get-pages-undefined/214833>\
**Category:** CUDA Programming and Performance\
**Created:** [May 18, 2022, 1:41pm UTC](https://forums.developer.nvidia.com/t/modpost-nvidia-p2p-get-pages-undefined/214833 "2022-05-18T13:41:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user98065](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user98065](https://forums.developer.nvidia.com/u/user98065)\
**Post date:** [May 18, 2022, 1:41pm UTC](https://forums.developer.nvidia.com/t/modpost-nvidia-p2p-get-pages-undefined/214833/1 "2022-05-18T13:41:24Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [May 18, 2022, 2:03pm UTC](https://forums.developer.nvidia.com/t/modpost-nvidia-p2p-get-pages-undefined/214833/2 "2022-05-18T14:03:41Z")

</div>

> <https://stackoverflow.com/questions/21565751/undefined-symbols-with-linux-kernel-driver-build-nvidia>

---

<div class="post-metadata">

**Author:** ![user98065](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user98065](https://forums.developer.nvidia.com/u/user98065)\
**Post date:** [May 18, 2022, 3:00pm UTC](https://forums.developer.nvidia.com/t/modpost-nvidia-p2p-get-pages-undefined/214833/3 "2022-05-18T15:00:06Z")

</div>

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:

```auto
/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).

```auto
#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?

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [May 18, 2022, 3:08pm UTC](https://forums.developer.nvidia.com/t/modpost-nvidia-p2p-get-pages-undefined/214833/4 "2022-05-18T15:08:07Z")

</div>

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](https://centos.pkgs.org/7/elrepo-x86_64/kmod-nvidia-510.47.03-1.el7_9.elrepo.x86_64.rpm.html) by our driver.

---

<div class="post-metadata">

**Author:** ![user98065](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user98065](https://forums.developer.nvidia.com/u/user98065)\
**Post date:** [May 18, 2022, 4:05pm UTC](https://forums.developer.nvidia.com/t/modpost-nvidia-p2p-get-pages-undefined/214833/5 "2022-05-18T16:05:35Z")

</div>

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)](https://docs.nvidia.com/cuda/gpudirect-rdma/index.html), compiled nvidia.ko, and added this line to the KAYA Makefile.

```auto
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:

```auto
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!

```
