8000 AssertionError: Torch not compiled with CUDA enabled · Issue #188 · rosinality/stylegan2-pytorch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

AssertionError: Torch not compiled with CUDA enabled #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the comm 8000 unity.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chengkeng opened this issue Feb 5, 2021 · 1 comment
Closed

AssertionError: Torch not compiled with CUDA enabled #188

chengkeng opened this issue Feb 5, 2021 · 1 comment

Comments

@chengkeng
Copy link

Hi!
Yesterday I felt that I was able to enjoy stylegan2-pytorch thoroughly and happily.
As a result, when I ran apply_factor.py and generate.py today, the following error occurred:


No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1'
Traceback (most recent call last):
File "generate.py", line 5, in
from model import Generator
File "C:\MyWork\My_GAN_Work\stylegan2-pytorch-master\model.py", line 11, in
from op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File "C:\MyWork\My_GAN_Work\stylegan2-pytorch-master\op_init_.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "C:\MyWork\My_GAN_Work\stylegan2-pytorch-master\op\fused_act.py", line 15, in
os.path.join(module_path, "fused_bias_act_kernel.cu"),
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\utils\cpp_extension.py", line 661, in load
is_python_module)
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\utils\cpp_extension.py", line 830, in _jit_compile
with_cuda=with_cuda)
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\utils\cpp_extension.py", line 879, in _write_ninja_file_and_build
with_cuda=with_cuda)
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\utils\cpp_extension.py", line 1114, in _write_ninja_file
cuda_flags = common_cflags + COMMON_NVCC_FLAGS + get_cuda_arch_flags()
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\utils\cpp_extension.py", line 977, in get_cuda_arch_flags
capability = torch.cuda.get_device_capability()
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\cuda_init
.py", line 328, in get_device_capability
prop = get_device_properties(device)
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\cuda_init
.py", line 334, in get_device_properties
init() # will define _get_device_properties and CudaDeviceProperties
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\cuda_init
.py", line 164, in init
lazy_init()
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\cuda_init
.py", line 192, in _lazy_init
check_driver()
File "C:\Users\Creator\miniconda3\envs\SG2_Pytorch\lib\site-packages\torch\cuda_init
.py", line 95, in _check_driver
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled


Some of the solutions found are to change the GPU running of the code to CPU running, but we have all successfully used the GPU before, and are suddenly forced to only use the CPU.Aren't we wasting resources?

And, reinstall pytorch, torchvision, and cudatoolkit:
conda uninstall pytorch torchvision cudatoolkit=10.1 pytorch
I tried to delete it and install it but it still doesn't work.

And today, NVIDIA in the lower right corner of win10 prompts that the graphics card driver can be upgraded, I clicked it, I don't know if it is installed, but I think my graphics card driver is always 460, there should be no changes, I don't know if it is affected.

Unexpectedly, some careless operations may affect such an important stylegan2-pytorch to fail to run, which is really terrible.

@chengkeng
Copy link
Author

This method works for me, thank you
pytorch/pytorch#30664 (comment)

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

No branches or pull requests

1 participant
0