From df63ef6f9a6aec2e8ce928017718ab45ae6c57b1 Mon Sep 17 00:00:00 2001 From: Steven Koo Date: Thu, 16 Jul 2020 14:23:02 -0500 Subject: docs: Update PCIe xport instructions for NI Repos This is an update to the documentation for installing the RIO PCIe transport infrastructure using the NI Linux Device Driver repository. --- host/docs/ni_rio_kernel.dox | 146 ++++++++++++++++++++++++++++++-------------- 1 file changed, 100 insertions(+), 46 deletions(-) (limited to 'host') diff --git a/host/docs/ni_rio_kernel.dox b/host/docs/ni_rio_kernel.dox index 960426e73..eabed00c6 100644 --- a/host/docs/ni_rio_kernel.dox +++ b/host/docs/ni_rio_kernel.dox @@ -4,87 +4,141 @@ \section linux_rio Linux NI RIO Installation and Usage +\subsection linux_overview Overview + +UHD can communicate with USRP X300 / X310 devices using the PCIe transport +connection. The ni-usrp-rio package in the NI Linux Device Drivers repository +includes the infrastructure to enable this functionality. This package is only +intended for UHD PCIe transport support. This does not include NI-USRP API support +on Linux. + \subsection linux_requirements Requirements In order to use the PCIe transport connection on the USRP X300 / X310 devices, you must install the NI USRP RIO driver stack. These include kernel modules -which must be loaded. +which are loaded using DKMS. Kernel headers are required to build these +modules. Only x86_64/AMD64 kernels are supported. -Your kernel version must be supported by the kernel modules. Only 64-bit kernels -are supported. +\subsection linux_installation Installing the Drivers in Linux -Currently, the latest supported kernel version is 4.2.x. +The NI Linux Device Driver repository can be found at NI Linux Device Drivers. -\subsection linux_installation Installing the Drivers in Linux +Note: This guide was written for the NI Linux Device Drivers 2020 release. + +Download the corresponding repository rpm or deb for your platform. + +For Fedora 31, download the EL8 repository. + +For Ubuntu 18.04, download the Bionic repository. + +Install the repository rpm or deb: + +Fedora + + rpm -i {ni drivers repository}.rpm + +Ubuntu + + dpkg -i {ni drivers repository}.deb + +Update package information: + +Fedora + + dnf check-update +Ubuntu + + apt update + +Install kernel-headers: + +Fedora + + dnf install kernel-devel -The NI USRP RIO installer can be found here. +Ubuntu -Download the installer and extract it with the following command: + apt install linux-headers-$(uname -r) - tar zxf niusrprio-installer-18.0.0.tar.gz +Note: You must ensure that the kernel header version is the same as the system kernel version. +You can check the system kernel version by running: -The files will be extracted into a directory called niusrprio-installer. + uname -r -To install the NI USRPRIO kernel modules and RPC server, run the following -command: +Install ni-usrp-rio: - sudo niusrprio-installer/INSTALL +Fedora -Select 'y' for each prompt, and the script will install all necessary -components. This script will automatically load all necessary kernel modules -for the duration of the session. + dnf install ni-usrp-rio + +Ubuntu + + apt install ni-usrp-rio + +Build kernel modules using DKMS: + + dkms autoinstall + +If you run into build errors, ensure the kernel headers are installed for +your current kernel. + +Reboot: + + reboot + +Run UHD application: + +At this point, the connected PCIe device should be visible from UHD. To verify this run: + + uhd_find_devices +or + + uhd_usrp_probe \subsection linux_enabling Enabling and Disabling Usage -Once everything is installed, run the following commands to enable use of the -X300/X310 over PCI Express: +The package installers automatically starts the niusrpriorpc service on boot. This service is required to +communicate with UHD. + +To start the service: - sudo /usr/local/bin/niusrprio_pcie start + systemctl start niusrpriorpc.service -To stop these processes, run the following command: +To stop the service: - sudo /usr/local/bin/niusrprio_pcie stop + systemctl stop niusrpriorpc.service -To check if the kernel modules are loaded and if the RPC server is running, run -the following command: +To disable the service on boot: - /usr/local/bin/niusrprio_pcie status + systemctl disable niusrpriorpc.service -NOTE: niusrprio_pcie start does not run when the host system is booted. -If you would like the USRP PCIe device to be available automatically after -a system restart, please create an init.d script that runs niusrprio_pcie start. +To reenable the service on boot: + + systemctl enable niusrpriorpc.service \subsection linux_swapping Hot-Plugging and Power-Cycling The USRP X3x0, NI USRP-294x and NI USRP-295x devices cannot be hot-swapped when connected over PCI Express. -Unplugging the PCI Express connection or powering the device should be done only after disabling the device or -powering off the host computer. - -WARNING: If the device is unplugged without running the `niusrprio_pcie stop` command, the system could become unstable. +Unplugging the PCI Express connection or powering the device should be done only after powering off the host computer. \subsection linux_upgrades Upgrading Kernels -The NI USRPRIO kernel modules are built for a specific kernel version. If the -kernel version is changed, the modules must be rebuilt for the current kernel. -The `niusrprio_pcie start` command checks for the necessary modules and rebuilds -them if necessary. - -If it ever becomes necessary to rebuild the modules manually, run the following: - - sudo /usr/local/bin/niusrprio_pcie stop - sudo /usr/local/bin/updateNIDrivers --no-prompt - sudo /usr/local/bin/niusrprio_pcie start +DKMS will automatically rebuild the kernel modules when updating kernels. Ensure that the +appropriate kernel headers are installed when updating kernel versions. -\subsection linux_uninstalling Uninstalling in Linux +\subsection linux_uninstalling Uninstalling the Driver in Linux -To uninstall the NI USRP RIO kernel modules and RPC server, run the following -command: +To uninstall ni-usrp-rio, run the following commands: - sudo /usr/local/bin/niusrprio_uninstall +Fedora: -Select y at the prompt, and the script will uninstall all installed components. + dnf remove ni-usrp-rio +Ubuntu: + + apt remove ni-usrp-rio + apt autoremove \section windows_rio Windows NI RIO Installation and Usage -- cgit v1.2.3