[clang] [Clang] Add timeout for GPU detection utilities (PR #94751)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 7 11:56:50 PDT 2024


Artem-B wrote:

> What's the config to set this by default without any graphics? 

https://docs.nvidia.com/deploy/driver-persistence/index.html

I usually use "nvidia-smi -i <target gpu> -pm ENABLED" to force the driver to be loaded permanently. 

As for `__nvcc_device_query`, my guess is that it just uses a handful of driver API calls. Nothing unusual, it's probably the standard sequence of cuInit/cuDeviceGetCount/cuDeviceGetAttribute like in this example: 
https://github.com/NVIDIA/cuda-samples/blob/5f97d7d0dff880bc6567faa4c5e62e389a6d6999/Samples/1_Utilities/deviceQueryDrv/deviceQueryDrv.cpp#L56

```
  checkCudaErrors(cuInit(0));
  checkCudaErrors(cuDeviceGetCount(&deviceCount));
  for (dev = 0; dev < deviceCount; ++dev) {
    checkCudaErrors(cuDeviceGetName(deviceName, 256, dev));
    ...
  }
```

https://github.com/llvm/llvm-project/pull/94751


More information about the cfe-commits mailing list