We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c79046 commit b13b701Copy full SHA for b13b701
torch/csrc/autograd/engine.cpp
@@ -350,7 +350,14 @@ auto Engine::ready_queue(int device) -> ReadyQueue& {
350
auto Engine::start_threads() -> void {
351
int num_devices = 0;
352
#ifdef WITH_CUDA
353
- THCudaCheck(cudaGetDeviceCount(&num_devices));
+ cudaError_t err = cudaGetDeviceCount(&num_devices);
354
+
355
+ // check for case of compiled with CUDA but no NVIDIA driver available
356
+ if (err == cudaErrorInsufficientDriver) {
357
+ num_devices = 0;
358
+ } else {
359
+ THCudaCheck(err);
360
+ }
361
#endif
362
ready_queues = std::vector<std::unique_ptr<ReadyQueue>>(num_devices + 1);
363
for (auto& queue : ready_queues) {
0 commit comments