Linux Users

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with NI-RIO Driver for Linux

I would like to use the C API to talk to a PCIe-7841R FPGA device. I installed the NI-RIO Driver for Linux version 12.1 on Debian 6.0.7. Kernel modules nikal and nipalk are loaded.

Following the instructions written here http://www.ni.com/white-paper/8638/en I wrote a simple C program to load the bitfile into the FPGA. The call NiFpga_Initialize() runs successfully. However, when trying to load the bitfile via

NiFpga_MergeStatus(&status, NiFpga_Open(NiFpga_fpgatest_Bitfile,

                                        NiFpga_fpgatest_Signature, "RIO0",

                                        NiFpga_OpenAttribute_NoRun, &session));

I get error 63192 meaning "Either the supplied resource name is invalid as a RIO resource name, or the device was not found. Use MAX to find the proper resource name for the intended device." according to http://zone.ni.com/reference/en-XX/help/370984R-01/criodevicehelp/ni_rio_fcf_error_codes/

Since MAX is not available on Linux, where can I find the correct resource name?

Running strace on my program provides

open("/proc/driver/ni", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3

getdents64(3, /* 2 entries */, 32768)   = 48

getdents64(3, /* 0 entries */, 32768)   = 0

close(3)                                = 0

munmap(0xb71e7000, 1433600)             = 0

fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb771a000

write(1, "Error downloading bitfile\n", 26Error downloading bitfile

) = 26

write(1, "Error -63192!\n", 14Error -63192!

)         = 14

So obviously the C API library is looking for something in /proc/drivers/ni. However, the directory is empty on my machine, and I assume this leads to the error message. Is there any other kernel module which must be loaded? The output of lsni is

bernd@pa-300026:~/fpgatest$ lsni

Scanning //localhost for devices...

System Configuration API resources found:

/sys/bus/pci/devices/0000:04:00.0

Any help is greatly appreciated.

0 Kudos
Message 1 of 28
(5,409 Views)

Hello! 

 

I have been facing the exact same problem with OpenSUSE Leap 15.1 for the past couple of weeks and I just stumbled upon your query.

It seems to me as if the lsni is recognizing the FPGA but fails to attribute an alias or resource name to the PCI device.

 

By any chance, did you find a solution to this problem?

Help would be appreciated.

 

Thanks in advance.

0 Kudos
Message 2 of 28
(3,741 Views)

Hello,

 

I have been trying to install OpenSUSE on an NI-IC3120 (Industrial Controller) and I am getting the same problem as you. Hence, I stumbled upon this query.

 

I personally feel like it has something to do with the OS not pinning an alias on a device it detects on the specific PCI bus (which is the FPGA).

 

Did you find a solution to this by any chance? Would really appreciate some help.

 

Thanks in advance.

0 Kudos
Message 3 of 28
(3,750 Views)

Which version are you trying to install?

 

Could you get the output of the following commands:

 

dkms status

 

lsmod

 

ls -la /dev/ni

 

 

0 Kudos
Message 4 of 28
(3,724 Views)

Thank you for the reply.

 

I am using the OpenSUSE Leap 15.1 with the NI-RIO 20.0 drivers. I checked the readme file of the driver and the OS version is supported with the 20.0 RIO drivers.

I have attached the outputs..

 

Looking forward to your reply.

0 Kudos
Message 5 of 28
(3,716 Views)

It looks like we don't support Linux desktop on the IC-3120.  The driver for its FPGA "nivisriopci" only has ipk installers built for NI Linux RT (it doesn't build rpms or debs).  I would recommend trying NI Linux RT on it if you haven't already.

 

Could you describe your use case for running OpenSUSE on the IC-3120?  Its something we could consider adding support for in the future.

0 Kudos
Message 6 of 28
(3,704 Views)

Hi!

 

I'm having the same problem with Ubuntu 20.04.4 with kernel 5.14.0-1048-oem. I have PXIe-7820R in a PXIe-1083 chassis connected via Thunderbolt to a PCIe Thunderbolt card on my PC. boltctl can find the device:

 

$ boltctl -U alias

● National Instruments PXIe-1083
├─ type: peripheral
├─ name: PXIe-1083
├─ vendor: National Instruments
├─ uuid: cb1efcd2-d9f0-f5fb-0df8-16746930783d
├─ generation: Thunderbolt 3
├─ status: authorized
│ ├─ domain: c4010000-0080-7d18-233f-393fe0824001
│ ├─ rx speed: 40 Gb/s = 2 lanes * 20 Gb/s
│ ├─ tx speed: 40 Gb/s = 2 lanes * 20 Gb/s
│ └─ authflags: none
├─ authorized: pe 12. elokuuta 2022 14.41.16
├─ connected: pe 12. elokuuta 2022 14.41.16
└─ stored: to 4. elokuuta 2022 10.00.03
├─ policy: iommu
└─ key: no

 

 

Here's my output for the previous commands:

 

dkms status

ni1045tr, 22.5.0f54, 5.14.0-1047-oem, x86_64: installed
ni1045tr, 22.5.0f54, 5.14.0-1048-oem, x86_64: installed
nibds, 22.5.0f46, 5.14.0-1047-oem, x86_64: installed
nibds, 22.5.0f46, 5.14.0-1048-oem, x86_64: installed
nicmmk, 22.5.0f54, 5.14.0-1047-oem, x86_64: installed
nicmmk, 22.5.0f54, 5.14.0-1048-oem, x86_64: installed
nicntdrk, 22.5.0f59, 5.14.0-1047-oem, x86_64: installed
nicntdrk, 22.5.0f59, 5.14.0-1048-oem, x86_64: installed
nicpciek, 22.5.0f54, 5.14.0-1047-oem, x86_64: installed
nicpciek, 22.5.0f54, 5.14.0-1048-oem, x86_64: installed
nidimk, 22.5.0f45, 5.14.0-1047-oem, x86_64: installed
nidimk, 22.5.0f45, 5.14.0-1048-oem, x86_64: installed
nikal, 22.5.0f45, 5.14.0-1047-oem, x86_64: installed
nikal, 22.5.0f45, 5.14.0-1048-oem, x86_64: installed
nimdbgk, 22.5.0f47, 5.14.0-1047-oem, x86_64: installed
nimdbgk, 22.5.0f47, 5.14.0-1048-oem, x86_64: installed
nimru2k, 22.5.0f45, 5.14.0-1047-oem, x86_64: installed
nimru2k, 22.5.0f45, 5.14.0-1048-oem, x86_64: installed
nimxdfk, 22.5.0f47, 5.14.0-1047-oem, x86_64: installed
nimxdfk, 22.5.0f47, 5.14.0-1048-oem, x86_64: installed
nimxik, 22.5.0f54, 5.14.0-1047-oem, x86_64: installed
nimxik, 22.5.0f54, 5.14.0-1048-oem, x86_64: installed
niorbk, 22.5.0f47, 5.14.0-1047-oem, x86_64: installed
niorbk, 22.5.0f47, 5.14.0-1048-oem, x86_64: installed
nipalk, 22.5.0f43, 5.14.0-1047-oem, x86_64: installed
nipalk, 22.5.0f43, 5.14.0-1048-oem, x86_64: installed
nipxicidk, 22.5.0f59, 5.14.0-1047-oem, x86_64: installed
nipxicidk, 22.5.0f59, 5.14.0-1048-oem, x86_64: installed
nipxiethernet, 22.5.0f54, 5.14.0-1047-oem, x86_64: installed
nipxiethernet, 22.5.0f54, 5.14.0-1048-oem, x86_64: installed
nipxifpk, 22.5.0f62, 5.14.0-1047-oem, x86_64: installed
nipxifpk, 22.5.0f62, 5.14.0-1048-oem, x86_64: installed
nipxigpk, 22.5.0f62, 5.14.0-1047-oem, x86_64: installed
nipxigpk, 22.5.0f62, 5.14.0-1048-oem, x86_64: installed
nipxim2, 22.5.0f54, 5.14.0-1047-oem, x86_64: installed
nipxim2, 22.5.0f54, 5.14.0-1048-oem, x86_64: installed
nipxirmk, 22.5.0f62, 5.14.0-1047-oem, x86_64: installed
nipxirmk, 22.5.0f62, 5.14.0-1048-oem, x86_64: installed
niriochinchk, 21.5.0f98, 5.14.0-1047-oem, x86_64: installed
niriomtk, 22.5.0f65, 5.14.0-1047-oem, x86_64: installed
niriomtk, 22.5.0f65, 5.14.0-1048-oem, x86_64: installed
NiRioSrv, 22.5.0f65, 5.14.0-1047-oem, x86_64: installed
NiRioSrv, 22.5.0f65, 5.14.0-1048-oem, x86_64: installed
nirseriesstc3k, 21.5.0f98, 5.14.0-1047-oem, x86_64: installed
nismbus, 22.5.0f62, 5.14.0-1047-oem, x86_64: installed
nismbus, 22.5.0f62, 5.14.0-1048-oem, x86_64: installed
nistreamk, 22.5.0f49, 5.14.0-1047-oem, x86_64: installed
nistreamk, 22.5.0f49, 5.14.0-1048-oem, x86_64: installed

 

 

lsmod

Module Size Used by
xt_conntrack 16384 1
xt_MASQUERADE 20480 1
nf_conntrack_netlink 49152 0
nfnetlink 20480 2 nf_conntrack_netlink
xfrm_user 36864 1
xfrm_algo 16384 1 xfrm_user
xt_addrtype 16384 2
iptable_filter 16384 1
iptable_nat 16384 1
nf_nat 49152 2 iptable_nat,xt_MASQUERADE
nf_conntrack 151552 4 xt_conntrack,nf_nat,nf_conntrack_netlink,xt_MASQUERADE
nf_defrag_ipv6 24576 1 nf_conntrack
nf_defrag_ipv4 16384 1 nf_conntrack
libcrc32c 16384 2 nf_conntrack,nf_nat
bpfilter 16384 0
br_netfilter 28672 0
bridge 266240 1 br_netfilter
stp 16384 1 bridge
llc 16384 2 bridge,stp
nipxifpk 73728 1
input_leds 16384 0
nimru2k 774144 1
nipxirmk 303104 2 nipxifpk
nimxdfk 593920 4 nimru2k,nipxifpk
nimdbgk 466944 6 nimru2k,nipxirmk,nimxdfk,nipxifpk
nidimk 376832 4 nimru2k,nipxirmk
niorbk 122880 6 nimdbgk,nimru2k,nipxirmk,nimxdfk,nipxifpk,nidimk
overlay 126976 0
nipalk 1241088 10 nimdbgk,nimru2k,niorbk,nipxirmk,nimxdfk,nipxifpk,nidimk
snd_hda_codec_realtek 147456 1
snd_hda_codec_generic 81920 1 snd_hda_codec_realtek
intel_rapl_msr 20480 0
intel_rapl_common 24576 1 intel_rapl_msr
snd_sof_pci_intel_tgl 16384 0
snd_sof_intel_hda_common 98304 1 snd_sof_pci_intel_tgl
soundwire_intel 40960 1 snd_sof_intel_hda_common
soundwire_generic_allocation 16384 1 soundwire_intel
soundwire_cadence 32768 1 soundwire_intel
snd_sof_intel_hda 20480 1 snd_sof_intel_hda_common
snd_sof_pci 20480 2 snd_sof_intel_hda_common,snd_sof_pci_intel_tgl
snd_sof_xtensa_dsp 16384 1 snd_sof_intel_hda_common
snd_sof 131072 2 snd_sof_pci,snd_sof_intel_hda_common
snd_soc_hdac_hda 24576 1 snd_sof_intel_hda_common
snd_hda_ext_core 32768 3 snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
snd_soc_acpi_intel_match 57344 2 snd_sof_intel_hda_common,snd_sof_pci_intel_tgl
snd_soc_acpi 16384 2 snd_soc_acpi_intel_match,snd_sof_intel_hda_common
soundwire_bus 81920 3 soundwire_intel,soundwire_generic_allocation,soundwire_cadence
x86_pkg_temp_thermal 20480 0
intel_powerclamp 20480 0
snd_soc_core 290816 4 soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hda
snd_compress 28672 1 snd_soc_core
ac97_bus 16384 1 snd_soc_core
mei_hdcp 24576 0
snd_hda_codec_hdmi 61440 2
snd_pcm_dmaengine 16384 1 snd_soc_core
coretemp 20480 0
snd_hda_intel 53248 4
i915 2478080 5
snd_intel_dspcfg 28672 2 snd_hda_intel,snd_sof_intel_hda_common
snd_intel_sdw_acpi 20480 2 snd_sof_intel_hda_common,snd_intel_dspcfg
snd_hda_codec 147456 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek,snd_soc_hdac_hda
nouveau 2068480 19
snd_hda_core 94208 9 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
nls_iso8859_1 16384 1
kvm_intel 311296 0
snd_hwdep 16384 1 snd_hda_codec
snd_pcm 122880 10 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_compress,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
snd_seq_midi 20480 0
snd_seq_midi_event 16384 1 snd_seq_midi
mxm_wmi 16384 1 nouveau
drm_ttm_helper 16384 1 nouveau
kvm 880640 1 kvm_intel
ttm 69632 3 drm_ttm_helper,i915,nouveau
drm_kms_helper 258048 2 i915,nouveau
snd_rawmidi 40960 1 snd_seq_midi
crct10dif_pclmul 16384 1
cec 53248 2 drm_kms_helper,i915
rc_core 61440 1 cec
ghash_clmulni_intel 16384 0
i2c_algo_bit 16384 2 i915,nouveau
dell_wmi 20480 0
snd_seq 73728 2 snd_seq_midi,snd_seq_midi_event
ledtrig_audio 16384 3 snd_hda_codec_generic,dell_wmi,snd_sof
fb_sys_fops 16384 1 drm_kms_helper
aesni_intel 376832 0
dell_smbios 28672 1 dell_wmi
syscopyarea 16384 1 drm_kms_helper
crypto_simd 16384 1 aesni_intel
snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi
dcdbas 20480 1 dell_smbios
sysfillrect 16384 1 drm_kms_helper
cryptd 24576 2 crypto_simd,ghash_clmulni_intel
nipxicidk 765952 0
intel_cstate 20480 0
snd_timer 40960 2 snd_seq,snd_pcm
nismbus 253952 0
snd 94208 21 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
mei_me 40960 1
dell_wmi_sysman 40960 0
ucsi_acpi 16384 0
typec_ucsi 40960 1 ucsi_acpi
firmware_attributes_class 16384 1 dell_wmi_sysman
dell_wmi_descriptor 20480 2 dell_wmi,dell_smbios
sparse_keymap 16384 1 dell_wmi
efi_pstore 16384 0
wmi_bmof 16384 0
nikal 126976 10 nimdbgk,nimru2k,niorbk,nipxirmk,nimxdfk,nipxicidk,nipxifpk,nismbus,nidimk,nipalk
ee1004 20480 0
mei 131072 3 mei_hdcp,mei_me
soundcore 16384 1 snd
sysimgblt 16384 1 drm_kms_helper
typec 57344 1 typec_ucsi
intel_skl_int3472 16384 0
power_ctrl_logic 20480 0
mac_hid 16384 0
acpi_tad 16384 0
acpi_pad 184320 0
sch_fq_codel 20480 2
ipmi_devintf 20480 0
ipmi_msghandler 114688 1 ipmi_devintf
msr 16384 0
parport_pc 45056 0
ppdev 24576 0
lp 20480 0
drm 557056 14 drm_kms_helper,drm_ttm_helper,i915,ttm,nouveau
parport 65536 3 parport_pc,lp,ppdev
ip_tables 32768 2 iptable_filter,iptable_nat
x_tables 49152 6 xt_conntrack,iptable_filter,xt_addrtype,ip_tables,iptable_nat,xt_MASQUERADE
autofs4 45056 2
hid_generic 16384 0
usbhid 57344 0
hid 139264 2 usbhid,hid_generic
i2c_i801 36864 0
crc32_pclmul 16384 0
e1000e 266240 0
i2c_smbus 20480 1 i2c_i801
thunderbolt 278528 0
nvme 49152 5
intel_lpss_pci 24576 0
nvme_core 131072 8 nvme
xhci_pci 24576 0
ahci 40960 0
intel_lpss 16384 1 intel_lpss_pci
xhci_pci_renesas 20480 1 xhci_pci
idma64 20480 0
libahci 36864 1 ahci
wmi 32768 7 dell_wmi_sysman,dell_wmi,wmi_bmof,dell_smbios,dell_wmi_descriptor,mxm_wmi,nouveau
video 53248 3 dell_wmi,i915,nouveau
pinctrl_tigerlake 32768 0

 

 

ls -la /dev/ni

total 0
drwxr-xr-x 2 root root 120 elo 12 2022 .
drwxr-xr-x 21 root root 5180 elo 12 2022 ..
crw-rw-rw- 1 root root 511, 256 elo 12 2022 'pci:0000:0d:00.0\nismbus_nismbus\0'
crw-rw-rw- 1 root root 510, 256 elo 12 2022 'pci:0000:11:00.0\nipxicid_chassisInternals\0'
crw-rw-rw- 1 root root 510, 258 elo 12 2022 'pci:0000:11:00.0\nipxicid_chassisUnityRouter\2'
crw-rw-rw- 1 root root 510, 257 elo 12 2022 'pci:0000:11:00.0\nipxicid_pxieTriggerRouter\1'

 

 

I think I have installed all required drivers (that I know of): 

General linux drivers for ni: https://www.ni.com/fi-fi/support/downloads/drivers/download.ni-linux-device-drivers.html#460375

FPGA related drivers (from here https://www.ni.com/pdf/manuals/ni-linux-device-drivers-2022-q3.html ) ni-fpga-interface ni-rio-mxie ni-rseries

 

How should I troubleshoot this problem? I have been stuck with problem for weeks now. 

 

0 Kudos
Message 7 of 28
(2,715 Views)

Could you attach the output of "lspci -v"?

0 Kudos
Message 8 of 28
(2,706 Views)

Already left the office so can't attach to device at the moment, but here is an output of lspci -vv that I ran before I left (unfortunately not ran as root). I'll give output as root on monday/tuesday when I get back to the office.

 

0 Kudos
Message 9 of 28
(2,703 Views)

Looks like the OS is seeing the device, which is good.

 

Could you get the contents of "dmesg" next?

0 Kudos
Message 10 of 28
(2,697 Views)