From df63ef6f9a6aec2e8ce928017718ab45ae6c57b1 Mon Sep 17 00:00:00 2001 From: Steven Koo Date: Thu, 16 Jul 2020 14:23:02 -0500 Subject: [PATCH] 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 | 148 ++++++++++++++++++++++++------------ 1 file changed, 101 insertions(+), 47 deletions(-) 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. - -Your kernel version must be supported by the kernel modules. Only 64-bit kernels -are supported. - -Currently, the latest supported kernel version is 4.2.x. +which are loaded using DKMS. Kernel headers are required to build these +modules. Only x86_64/AMD64 kernels are supported. \subsection linux_installation Installing the Drivers in Linux -The NI USRP RIO installer can be found here. +The NI Linux Device Driver repository can be found at NI Linux Device Drivers. -Download the installer and extract it with the following command: +Note: This guide was written for the NI Linux Device Drivers 2020 release. - tar zxf niusrprio-installer-18.0.0.tar.gz +Download the corresponding repository rpm or deb for your platform. -The files will be extracted into a directory called niusrprio-installer. +For Fedora 31, download the EL8 repository. -To install the NI USRPRIO kernel modules and RPC server, run the following -command: +For Ubuntu 18.04, download the Bionic repository. - sudo niusrprio-installer/INSTALL +Install the repository rpm or deb: + +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. + 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 + +Ubuntu + + apt install linux-headers-$(uname -r) + +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: + + uname -r + +Install ni-usrp-rio: + +Fedora + + 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. - sudo /usr/local/bin/niusrprio_pcie start +To start the service: -To stop these processes, run the following command: + systemctl start niusrpriorpc.service - sudo /usr/local/bin/niusrprio_pcie stop +To stop the service: -To check if the kernel modules are loaded and if the RPC server is running, run -the following command: + systemctl stop niusrpriorpc.service - /usr/local/bin/niusrprio_pcie status +To disable the service on boot: -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. + systemctl disable niusrpriorpc.service + +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. +DKMS will automatically rebuild the kernel modules when updating kernels. Ensure that the +appropriate kernel headers are installed when updating kernel versions. -If it ever becomes necessary to rebuild the modules manually, run the following: +\subsection linux_uninstalling Uninstalling the Driver in Linux - sudo /usr/local/bin/niusrprio_pcie stop - sudo /usr/local/bin/updateNIDrivers --no-prompt - sudo /usr/local/bin/niusrprio_pcie start +To uninstall ni-usrp-rio, run the following commands: -\subsection linux_uninstalling Uninstalling in Linux +Fedora: -To uninstall the NI USRP RIO kernel modules and RPC server, run the following -command: - - sudo /usr/local/bin/niusrprio_uninstall - -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