LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NIFPGA Python library freezes Windows when using FIFO

Solved!
Go to solution

Hello,

 

I'm using NIFPGA Python library to communicate with FPGA. I can open a session, write to controls and read indicators on the front panel, but when I set up a FIFO and try to use the FIFO from Python, each time I try it, Windows freezes down completely - it doesn't react to mouse movements or keys - and it needs to be powered off and on again. Below is a screenshot of the minimal test VI that i'm using; it is essentially the example from the Python library documentation (here), consisting of a Host to Target FIFO and a Target to Host FIFO, connected to each other.

 

okahilak_3-1650821767845.png

 

The Python script that I'm using to access the FIFO is also the example from the library's documentation (here). Both the test VI and the test Python script are included in the attached zip file, as well as the minimal test project I'm using, which includes the FIFOs. I created the FIFOs by selecting New->FIFO in the project explorer - I changed the type to "Host to Target - DMA" for Host to Target Fifo, and "Target to Host - DMA" for Target to Host Fifo, otherwise I kept the default settings.

 

I'm using PXIe-7820R in a NI chassis, connected to my PC using Thunderbolt. My PC is running Microsoft Windows 10 Home, version 10.0.19043 Build 19043, and has Intel Core i5-11600 @ 2.80GHz, 32 GB of memory. My LabView version is 21.0 (32-bit). I'm using Python 3.8.

 

How should I proceed to figure out what's wrong? Should I contact NI directly - for instance, could the FPGA device be defective? Am I doing something clearly wrong? Ideally, I'd like to try it on a different computer and a different FPGA unit, but due to practical constraints, I cannot easily do that. Would it be useful to try it with an older version of LabView?

 

Thanks, any help is appreciated!

0 Kudos
Message 1 of 4
(1,663 Views)
Solution
Accepted by topic author okahilak

Newer versions of Windows have thunderbolt DMA security features that might not be playing nice with the R Series card.  You might google around some and check if you machine has them enabled and see if disabling them changes the behavior at all.  Usually if you are running into those though your machine will blue screen rather than just freeze.

0 Kudos
Message 2 of 4
(1,577 Views)

Thanks, that seems to be the case indeed: I was able to try it on another computer, which did not have kernel DMA protection enabled, and it worked fine. Now I'll just need to figure out how to disable it on my primary computer. (For the record: When I tried several times on the computer with the kernel DMA protection enabled, most of the times it freezed completely, but once it gave me a blue screen. Therefore, it seems that either behavior can occur.)

 

By the way: I really like the NIFPGA Python library, but it would be great if that DMA protection caveat was mentioned as a note or a warning box in the Sphinx-generated documentation of the library (here). I'm sure I cannot be the only one who has had trouble with this and has a hard time figuring out the cause.

 

Thanks again for the help!

0 Kudos
Message 3 of 4
(1,552 Views)

I asked around and in general we expect DMA protection to work with our devices.  Apparently some recent Windows updates should improve compatibility with PXI devices, but since you are using a PXIe device I don't expect that to matter. You might see if any BIOS updates are available for your machine and give those a try.

 

If you end up needing DMA Protection enabled on your machine and its still not working with it enabled, then you might want to open a service request.

0 Kudos
Message 4 of 4
(1,534 Views)