Undefined reference to `nvidia_p2p_put_pages'

I am trying to build my custom kernel with drivers which uses functions like nvidia_p2p_put_pages, nvidia_p2p_free_page_table, nvidia_p2p_dma_map_pages

Using the nvbuild.sh script I am unable to build a kernel.
While linking I get an undefined reference to nvidia_p2p_put_pages (and alikes…)
I included #include <linux/nv-p2p.h> in my code.

Do I need to enable soms extra buildflags?

I am using the kernel sources as in the downloadcenter available, just added my own driver and set it to build in the Makefile by obj-y += my_driver.o

Hi,

What is the purpose to use this? Are you trying something related to RDMA?

Hi,

I am trying to let a PCIe device directly access CUDA memory (as in the example jetson-rdma-picoevb )

Which makefile did you add your own driver.o?

The Makefile located at kernel/kernel-4.9/drivers/mfd/Makefile

You can try to refer to how other makefile write… If you just modify these two lines in a repo that is not related to nvgpu… then of course it would not link the function you want.

So… the complete nvgpu and nvidia folders are not linked while building a kernel?
How in the world are the nvidia drivers made available for the kernel? (eg. tmpm32xi2c)

tried to move all to kernel/nvidia/drivers/mfd or kernel/nvgpu/drivers/gpu… nope did not do anything…

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Sorry for the late response, is this still an issue to support? Thanks