Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with OpenSUSE, Linux Kernel 5.6.4, and NI software drivers

Highlighted

Hello, I updated my OpenSUSE Tubmleweed install this weekend and discovered that my NI software drivers don't work anymore. This includes nilsdev, nidaqmxconfig, and nipxiconfig -lv. My compiled DAQmx programs don't run. I did some troubleshooting and found out some interesting changes happened in the Linux kernel and thought I would share what I found. I know OpenSUSE Tumbleweed isn't officially supported but I wanted to share what I found since this appears to affect Linux kernel versions 5.6+.

 

Here's what happened when I tried to run nilsdev

 

localhost:~> nilsdev
libnipalu.so failed to initialize
Verify that nipalk.ko is built and loaded.
Aborted (core dumped)

 

 

I've had kernel updates break DAQmx and other drivers and usually I did a complete uninstall of NI software and reinstall to fix it. This time that didn't work. When I tried running "dkms autoinstall" the builds failed as you can see below.

 

localhost:~> sudo dkms autoinstall

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j12 KERNELRELEASE=5.6.4-1-default KERNELDIR=/lib/modules/5.6.4-1-default/build KERNELVER=5.6.4-1-default build sysprep...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.6.4-1-default (x86_64)
Consult /var/lib/dkms/nikal/19.5.0f0/build/make.log for more information.

 

 

I looked into the make.log at the location and discovered there were incompatible pointer types between the Linux files and nikal.c. See below:

 

Making nikal.ko
  CC [M]  /var/lib/dkms/nikal/19.5.0f0/build/nikal.o
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c: In function ‘nNIKAL200_createKALInterfaceProperties’:
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:1456:35: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1456 |                                   &nNIKAL250_procFops,
      |                                   ^~~~~~~~~~~~~~~~~~~
      |                                   |
      |                                   nLinux_fileOperations * {aka struct file_operations *}
In file included from /var/lib/dkms/nikal/19.5.0f0/build/nikal.c:60:
/usr/src/linux-5.6.4-1/include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘nLinux_fileOperations *’ {aka ‘struct file_operations *’}
   59 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~

 

 

 

I found this proc: convert everything to "struct proc_ops"  in the Linux kernel repo. It appears that the function signatures were changed making the current nikal.c and other NI files incompatible with kernel 5.6.4. There were more build errors in the make.log for nikal.c which I will attach to this post. The other kernel modules for NI software also failed to build.

Message 1 of 6
(573 Views)
Highlighted

Hi all,

 

Same problem here with Fedora 32 and kernel 5.6.16.

 

I see that the drivers for Windows were updated on the 5/15/2020 (cf https://www.ni.com/en-us/support/downloads/drivers/download.ni-daqmx.html#346240).

When can we expect a new Linux driver ?

 

Thanks for you help.
Didier

 

DKMS make.log for nikal-19.5.0f0 for kernel 5.6.16-300.fc32.x86_64 (x86_64)
lun. 15 juin 2020 09:08:05 CEST
Using kernel headers found in:
/lib/modules/5.6.16-300.fc32.x86_64/build
If this location is not correct, then set the KERNELHEADERS
environment variable to the location of the kernel headers.

Verifying that KERNELHEADERS has a valid kernel source path:
Passed.

Using kernel configuration files found in:
/lib/modules/5.6.16-300.fc32.x86_64/build
If this location is not correct, then set the KERNELVER
environment variable to the name of an installed kernel, or
set KERNELDIR to the location of the kernel configuration files.

Verifying that KERNELDIR has a valid kernel config path:
Passed.

Testing kernel capabilities and interfaces:
Kernel has version.h in include/generated/uapi/: yes
Kernel's struct module layout members: init_layout and core_layout
Number of arguments for do_munmap(): 4 (uf)
Kernel has vm_fault_t: yes
Kernel has vm_mmap(): yes
Kernel has vm_munmap(): yes
Kernel has VM_RESERVED: no
vm_operations_struct fault handler callback takes a vm_area_struct parameter: no
Kernel get_user_pages() requires: implicit "current" task and combined page flags param.
Kernel struct pci_dev has busn_res member: yes
Kernel acpi_op_remove callback has additional "type" parameter: no
pte_offset function: pte_offset_kernel()
Levels in page table: 5
Kernel has kzalloc: yes
Kernel has chained SGL support: limited
USB altsetting name: cur_altsetting
Kernel has usb_get_intf(): yes
Kernel has intf_cache member in usb_host_config: yes
Kernel has ep[] members in usb_device: yes
Kernel exports usb_set_configuration(): yes
Units of USB_CTRL_GET_TIMEOUT: msec
Kernel has mutex method: yes
Kernel has wait_for_completion_interruptible: yes
Kernel has work_struct and delayed_work: yes
Kernel timer_list has data member: no
Kernel has ioremap_wc: yes
Kernel has cred.h: yes
Kernel has uidgid.h: yes
Kernel has UMH constants: no
Kernel has create_proc_read_entry: no
Kernel has namespaced generic netlink API: yes
Kernel has genlmsg_new: yes
Kernel has family genlmsg_put: yes
Kernel genl_family member 'ops' is public: yes
Kernel has family genl_ops_groups: no
Kernel has RS-485 serial_core support: no
Kernel RS-485 config options are per-uart: yes
Kernel struct uart_ops has set_wake(): no
Kernel uses tty_port instead of tty_struct for tty helper functions: yes

Writing detected kernel capabilities to Kbuild
If the values stored are incorrect they can be changed before running make.

Making nikal.ko
CC [M] /var/lib/dkms/nikal/19.5.0f0/build/nikal.o
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c: In function ‘nNIKAL200_createKALInterfaceProperties’:
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:1456:35: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
1456 | &nNIKAL250_procFops,
| ^~~~~~~~~~~~~~~~~~~
| |
| nLinux_fileOperations * {aka struct file_operations *}
In file included from /var/lib/dkms/nikal/19.5.0f0/build/nikal.c:60:
./include/linux/proc_fs.h:61:13: note: expected ‘const struct proc_ops *’ but argument is of type ‘nLinux_fileOperations *’ {aka ‘struct file_operations *’}
61 | const struct proc_ops *,
| ^~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c: In function ‘nNIKAL200_registerProperty’:
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:1711:35: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
1711 | &nNIKAL250_procFops,
| ^~~~~~~~~~~~~~~~~~~
| |
| nLinux_fileOperations * {aka struct file_operations *}
In file included from /var/lib/dkms/nikal/19.5.0f0/build/nikal.c:60:
./include/linux/proc_fs.h:61:13: note: expected ‘const struct proc_ops *’ but argument is of type ‘nLinux_fileOperations *’ {aka ‘struct file_operations *’}
61 | const struct proc_ops *,
| ^~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c: In function ‘nNIKAL1_getMonotonicCounter’:
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:3957:20: error: storage size of ‘ts’ isn’t known
3957 | struct timespec ts;
| ^~
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:3958:4: error: implicit declaration of function ‘getrawmonotonic’ [-Werror=implicit-function-declaration]
3958 | getrawmonotonic(&ts);
| ^~~~~~~~~~~~~~~
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:3959:11: error: implicit declaration of function ‘timespec_to_ns’; did you mean ‘timespec64_to_ns’? [-Werror=implicit-function-declaration]
3959 | return timespec_to_ns(&ts);
| ^~~~~~~~~~~~~~
| timespec64_to_ns
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:3957:20: warning: unused variable ‘ts’ [-Wunused-variable]
3957 | struct timespec ts;
| ^~
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c: In function ‘nNIKAL100_getTimeOfDay’:
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:4006:20: error: storage size of ‘systemTime’ isn’t known
4006 | nLinux_timeSpec systemTime;
| ^~~~~~~~~~
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:4007:4: error: implicit declaration of function ‘getnstimeofday’ [-Werror=implicit-function-declaration]
4007 | getnstimeofday(&systemTime);
| ^~~~~~~~~~~~~~
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:4006:20: warning: unused variable ‘systemTime’ [-Wunused-variable]
4006 | nLinux_timeSpec systemTime;
| ^~~~~~~~~~
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c: In function ‘nNIKAL200_commonPCIProbe’:
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:4776:1: warning: label ‘disable_msi’ defined but not used [-Wunused-label]
4776 | disable_msi:
| ^~~~~~~~~~~
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c: In function ‘nNIKAL1_getMonotonicCounter’:
/var/lib/dkms/nikal/19.5.0f0/build/nikal.c:3960:1: warning: control reaches end of non-void function [-Wreturn-type]
3960 | }
| ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:268: /var/lib/dkms/nikal/19.5.0f0/build/nikal.o] Error 1
make[1]: *** [Makefile:1695: /var/lib/dkms/nikal/19.5.0f0/build] Error 2
make: *** [Makefile:92: nikal.ko] Error 2 

 

Message 2 of 6
(391 Views)
Highlighted

Hi all,

 

It seems NI silently answered my request. There is a new version of the linux drivers since the 7/16/2020:

https://www.ni.com/en-us/support/downloads/drivers/download.ni-linux-device-drivers.html

 

Cheers,
Didier

0 Kudos
Message 3 of 6
(299 Views)
Highlighted

But unfortunately, they didn't fix the incompatibilities with recent kernel versions...

NI, please!!!

0 Kudos
Message 4 of 6
(293 Views)
Highlighted

The new drivers do work for me on Linux Mint 19 with kernel 4.18 using the .deb packages so it's not all bad. Debian based distros are finally supported at least.

0 Kudos
Message 5 of 6
(285 Views)
Highlighted

Same for me, still not working on Fedora 32 (5.6 kernel).

 

I was trying to run NI-DAQmx on a PC with a Ryzen 3700X CPU. However, CentOS 8 seems to be too old for the hardware (I couldn't get it to install), and Fedora 32 comes with a kernel that's too new for NI drivers. I tried installing an older 5.5 kernel on Fedora 32 and, although the NI drivers compiled correctly, the system wouldn't boot afterwards.

 

Luckily, the new drivers support Ubuntu Bionic officially. Support is partial, but NI-DAQmx is included, so I switched back to Bionic, and now have everything working perfectly on a 5.4 kernel.

0 Kudos
Message 6 of 6
(275 Views)