Skip to content

PyTorch 1.7.0 CUDA driver warning #47038

@carmocca

Description

@carmocca

🐛 Bug

The following warning appears only on torch==1.7.0

../../../virtualenv/python3.8.3/lib/python3.8/site-packages/torch/cuda/__init__.py:52

  /home/travis/virtualenv/python3.8.3/lib/python3.8/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)

    return torch._C._cuda_getDeviceCount() > 0

Looking at the pull request that introduced it, no warning should be raised for "call to device_count()" with "no gpus"

Having to filter this warning every time device_count is called is not ideal.

To Reproduce

torch.cuda.device_count()

Expected behavior

Does not raise a warning.

cc @ezyang @gchanan @zou3519 @bdhirsh @heitorschueroff @ngimel

Metadata

Metadata

Assignees

Labels

module: cudaRelated to torch.cuda, and CUDA support in generaltriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions