Skip to content

Commit

Permalink
fix cudadevrt availability checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Jul 19, 2024
1 parent 2f56a70 commit 6d849cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backends/cuda/cuda_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ CUDADevice::CUDADevice(Context &&ctx,
}
// test if the device runtime library is recognized by the driver
if (!_cudadevrt_library.empty()) {
// TODO: this check can consume hundreds of milliseconds! Is there a better way?
// generate some non-sense kernel source with dynamic parallelism
auto dummy_kernel_src = R"(__global__ void a() {} __global__ void b() { a<<<1,1>>>(); })";
auto dummy_ptx = _compiler->compile(builtin_kernel_src, "luisa_builtin.cu", options);
auto dummy_kernel_src = R"(__global__ void a() {} __global__ void b() { a<<<1024,32>>>(); })";
auto dummy_ptx = _compiler->compile(dummy_kernel_src, "dummy_devrt_check.cu", options);
void *output_cubin = nullptr;
size_t output_cubin_size = 0u;
with_handle([&] {
Expand Down

0 comments on commit 6d849cb

Please sign in to comment.