Skip to content

Conversation

@vinx13
Copy link
Member

@vinx13 vinx13 commented Jan 10, 2024

Using cudaDeviceGetAttribute will set the global error code when the device doesn't exist and will impact subsequent CUDA API calls.

cc @tqchen @junrushao

Using `cudaDeviceGetAttribute` will set the global error code when the
device doesn't exist and will impact subsequent CUDA API calls.
@github-actions github-actions bot requested review from junrushao and tqchen January 10, 2024 01:06
@vinx13 vinx13 merged commit 524ec5f into apache:main Jan 10, 2024
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Apr 18, 2024
This commit resolves a bug that was introduced in
apache#16377.  If no CUDA-capable GPUs are
present, the call to `cudaGetDeviceCount` will return an error, which will
be raised as an exception by the `CUDA_CALL` macro.  However, checking
the `kExist` flag is valid even if no GPUs are present.

This commit removes the use of `CUDA_CALL`, and instead returns false
in this case.
tqchen pushed a commit that referenced this pull request Apr 18, 2024
…6903)

This commit resolves a bug that was introduced in
#16377.  If no CUDA-capable GPUs are
present, the call to `cudaGetDeviceCount` will return an error, which will
be raised as an exception by the `CUDA_CALL` macro.  However, checking
the `kExist` flag is valid even if no GPUs are present.

This commit removes the use of `CUDA_CALL`, and instead returns false
in this case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants