hsharma35 / dnnweaver2

Open Source Specialized Computing Stack for Accelerating Deep Neural Networks.
Apache License 2.0
206 stars 74 forks source link

MMAP OSError: [Errno 22] Invalid argument #10

Open Morett07 opened 4 years ago

Morett07 commented 4 years ago

Hello,

I managed to generate the bitstream on a KCU105 and now I try to run the tutorial but I have an error when the memory map is called :

"self.pci_cl_ctrl_mmap = mmap.mmap(self.pci_cl_ctrl_fd.fileno(), 32*1024, prot=mmap.PROT_READ|mmap.PROT_WRITE)"

"OSError: [Errno 22] Invalid argument"

This error seems to be related to the first argument self.pci_cl_ctrl_fd.fileno()

I tried to use the os.open function instead but I obtain the same error.

Do you have an Idea to solve this issue ?

Thank you,

Best regards

Morett07 commented 4 years ago

I solved the problem by adding mmap.MAP_ANONYMOUS in parameter :

"self.pci_cl_ctrl_mmap = mmap.mmap(self.pci_cl_ctrl_fd.fileno(), 4*1024, mmap.MAP_ANONYMOUS|mmap.MAP_SHARED, prot=mmap.PROT_READ|mmap.PROT_WRITE)"

Another error occured when the python script try to write data to device :

File "tuto.py", line 91, in

fpga_manager.write('pci_cl_data', 0, inst_binary)

File "PATH/memspace.py", line 49, in write

os.write(self.h2c_fd, data) OSError: [Errno 5] Input/output error

@hsharma35 do I need specific options in XDMA for h2c and c2h ?

nazarihome commented 4 years ago

@Morett07 @hsharma35 I was wondering if you could resolve this Input/output error. I am getting the same error.

Morett07 commented 4 years ago

Hi @nazarihome,

Unfortunately no, I didn't manged and didn't spend much time on it.

Maybe the linux distribution was the problem (debian), what is yours ?