Activating USBIP on buildKernelAndModules from JetsonHacksNano

Hello,

I would like to use the NVidia Jetson Nano as a remote station, with some onboard vision computation, and some remote ones.

For the onboard vision, I need to use an Intel Realsense camera, and thus install a patched version of the kernel. The script from https://github.com/JetsonHacksNano/installLibrealsense does that perfectly well.

For the remote computations, I need to forward an USB port to an other computer, using usbip. That’s where the problem happens. I know how to install it via apt, but it will install it for the kernels that comes from the repo. The kernel that is built by the installLibRealsense scripts (that uses the https://github.com/JetsonHacksNano/buildKernelAndModules script) is built from sources, and is not impacted by the installation of linux-tools-generic package.
The sources from which the kernel is built have the usbip module, but it is not enabled for the build. As I’ve never built a kernel, I have no idea what to do to compile and active usbip module.
Can someone explain me how to install this module, either by hand or modifying some of the scripts?

Thanks for your help!

Hi pascalvh9zj,

I can’t answer this, but you can refer to L4T document to see if can help for kernel customization:
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fkernel_custom.html%23

Thanks

Hi pascalvh9zj,

Did you get usbip running?

I wanted to use Virtualhere for USB port sharing and also needed usbip.

I compiled the kernel modules, loaded them, and everything works!

LMK if you want the specifics.

Captain Data

Thanks for your answers.

That was it, compile and load the kernel modules, but as I’m novice in kernel stuff, it took me a bit of time to figure out how to do that specifically. Now everything works as I want.
Thank you both for for leading me in the right direction.

Pascal

Hi CaptainData and pascalvh9zj,

Would you please mind sharing how you were able to compile and load the kernel modules? If you have a link to a tutorial or example, that wold be fantastic. Also, where do I get the source code for USBIP to build? I have never dealt with the kernel, and I am fairly new with Linux in general. It also doesn’t help that I am not familiar with any of the nomenclature, so it makes it incredibly hard to google what I am looking for. Any help would be greatly appreciated!

Hi,

If your kernel is installed via the package, you have to do as with every linux, install the tools and cloud-tools packages associated with your kernel and the usbip package, that will install everything.

If you’re using the kernel built from https://github.com/JetsonHacksNano/buildKernelAndModules, you’ll have the sources of the kernel in /usr/src/kernel/kernel-4.9.

In this folder, type
sudo make menuconfig
In this menu, go to :
Device Drivers
-> USB support

and activate the following modules (putting a M inside) :
USB/IP support
vhci lcdCI hcd
Host driver
VUDC driver
then exit the menu and type sudo make.

This will generate 4 .ko in /usr/src/kernel/kernel-4.9/drivers/usb/usbip
Copy them to /lib/modules/4.9.140-tegra/kernel/drivers/usb/usbip/

Add the following lines in /lib/modules/4.9.140-tegra/modules.dep

kernel/drivers/usb/usbip/vhci-hcd.ko: kernel/drivers/usb/usbip/usbip-core.ko
kernel/drivers/usb/usbip/usbip-core.ko:
kernel/drivers/usb/usbip/usbip-vudc.ko: kernel/drivers/usb/usbip/usbip-core.ko
kernel/drivers/usb/usbip/usbip-host.ko: kernel/drivers/usb/usbip/usbip-core.ko

Now, you have the kernel modules (that you’ll have to load each time, you can compile them to be directly in the kernel, but I’m not expert enough to explain that part).

Now, go to /usr/src/kernel/kernel-4.9/tools/usb/usbip
You have a autogen script to install usbip software
sudo ./autogen.sh
sudo ./configure
sudo make
sudo make install

And tadaaa.