intel / DML

Intel® Data Mover Library (Intel® DML)
https://intel.github.io/DML/
MIT License
81 stars 17 forks source link

compiler optimization issue when allocation the transfer buffer on heap memory #32

Closed Sean58238 closed 9 months ago

Sean58238 commented 9 months ago

example code: mem_move change to allocation source and destination to allocate from stack to heap and init the buffer:

uint8_t* source = (uint8_t *)malloc(BUFFER_SIZE);
uint8_t* destination = (uint8_t *)malloc(BUFFER_SIZE);
memset(source, 1, BUFFER_SIZE);
memset(destination, 0, BUFFER_SIZE);

compile and run , return error 102

if change the compile optimization running successful, like: cmake -DCMAKE_BUILD_TYPE=Debug .. or cmake -DCMAKE_BUILD_TYPE=-O0 ..

mzhukova commented 9 months ago

Hi @Sean58238, I was not able to reproduce the issue on my side (using Debug build) and I don't believe changing the allocation to malloc should lead to failure.

102 status is essentially "No work queues are available" (see https://github.com/intel/DML/blob/develop/include/dml/dmldefs.h#L330), could you please double check the device configuration on your side?

Also, you could try building DML with -DCMAKE_BUILD_TYPE=Debug -DLOG_HW_INIT=ON and it should display a lot of debug diagnostic information that could tell you whether dsa instances and queues are available.

mzhukova commented 9 months ago

hi @Sean58238 since this is a work queue availability issue and not a bug in the DML, could we close the issue?

Sean58238 commented 9 months ago

close first , if reproduce we can share environment