-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QST] get compressed data from device: get always null values #101
Comments
And yet another post: |
This issue has been labeled |
This issue has been labeled |
Hi @andreamartini |
This issue has been labeled |
Hi,
I have been experimenting with the nvCOMP API, the low level quick start example ( “low_level_quickstart_example.cpp”).
I am looking for obtaining the compressed data that should be generated by the nvcompBatchedLZ4CompressAsync call, and than save them to files.
After nvcompBatchedLZ4CompressAsync call (terminated with success), i am able to get the host_compressed_bytes for each chunk in this way:
size_t* host_compressed_bytes;
cudaMallocHost(&host_compressed_bytes, sizeof(size_t) * batch_size);
cudaMemcpy(host_compressed_bytes, device_compressed_bytes, sizeof(size_t) * batch_size, cudaMemcpyDeviceToHost);
Now, host_compressed_bytes[i] contains the chunk size in bytes, and i print the results to console:
Following a snippet code for copying from device to host:
cudaFreeHost(host_compressed_ptrs);
cudaMallocHost(&host_compressed_ptrs, sizeof(size_t) * batch_size);
for (size_t i = 0; i < batch_size; i++)
{
cudaMallocHost(&host_compressed_ptrs[i], host_compressed_bytes[i]);
printf(" host_compressed_ptrs[%zu] = %p\n", i, host_compressed_ptrs[i]);
cudaMemcpy(host_compressed_ptrs[i], &device_compressed_ptrs[i], host_compressed_bytes[i], cudaMemcpyDeviceToHost);
}
with result:
host_compressed_ptrs[0] = 00000002052F4C00
host_compressed_ptrs[1] = 0000000205304E00
host_compressed_ptrs[2] = 0000000205315000
host_compressed_ptrs[3] = 0000000205325200
host_compressed_ptrs[4] = 0000000205335400
...
host_compressed_ptrs[14] = 00000002053D6800
host_compressed_ptrs[15] = 00000002053E6A00
The problem is that i cannot get compressed data from device, i mean, i get for each chunk a sequence of null value.
Infact, if i try to print the first and last 5 bytes of each chunk, i get:
May you please advise what I am doing wrong? thank you in advance.
NB:
I am using:
Ref. to. https://forums.developer.nvidia.com/t/nvcomp-get-compressed-data-from-device/288791
The text was updated successfully, but these errors were encountered: