Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

thrust partition fails for size_t{3} * 1024 * 1024 * 1024 elements #1618

Closed
seunghwak opened this issue Feb 12, 2022 · 3 comments
Closed

thrust partition fails for size_t{3} * 1024 * 1024 * 1024 elements #1618

seunghwak opened this issue Feb 12, 2022 · 3 comments
Assignees
Labels
thrust type: bug: functional Does not work as intended.

Comments

@seunghwak
Copy link

Test environment
GA102 (48 GB GPU memory)
CUDA 11.4
Thrust 1.15.0

The code below fails with cudaErrorIllegalAddress

It seems like this works up to size_t{2} * 1024 * 1024 * 1024 + small number (didn't crash, haven't verified the results), but fails with size_t{3} * 1024 * 1024 * 1024 and size_t{4} * 1024 * 1024 * 1024. I suspect some sort of an integer overflow issue.

  thrust::device_vector<int8_t> values(size_t{3} * 1024 * 1024 * 1024);
  thrust::tabulate(thrust::device, values.begin(), values.end(), []__device__(auto i) { return static_cast<int8_t>(i % 2); });
  thrust::partition(thrust::device, values.begin(), values.end(), []__device__(auto v) { return (v == int8_t{0}); });
terminate called after throwing an instance of 'thrust::system::system_error'
  what():  CUDA free failed: cudaErrorIllegalAddress: an illegal memory access was encountered
@lilohuang
Copy link
Contributor

I think it's a known limitation. NVIDIA/cccl#744

@alliepiper
Copy link
Collaborator

@lilohuang is correct -- this is a known issue that's tracked by NVIDIA/cub#212.

@alliepiper alliepiper added the type: bug: functional Does not work as intended. label Mar 7, 2022
@jrhemstad jrhemstad added this to CCCL Aug 11, 2022
@ericniebler
Copy link
Collaborator

Closed as duplicate

@ericniebler ericniebler closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2023
@github-project-automation github-project-automation bot moved this to Done in CCCL Feb 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
thrust type: bug: functional Does not work as intended.
Projects
Archived in project
Development

No branches or pull requests

5 participants