Skip to content
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 community.

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

Nvidia Only ? #14

Closed
LeoKesler opened this issue May 22, 2023 · 5 comments
Closed

Nvidia Only ? #14

LeoKesler opened this issue May 22, 2023 · 5 comments

Comments

@LeoKesler
Copy link

I am trying to use but I get this error:

python gradio_app.py
C:\Program Files\Python39\lib\site-packages\torch\utils\cpp_extension.py:358: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
  warnings.warn(f'Error checking compiler version for {compiler}: {error}')
Traceback (most recent call last):
  File "E:\000000000\DragGAN-main\gradio_app.py", line 9, in <module>
    from drag_gan import drag_gan, stylegan2
  File "E:\000000000\DragGAN-main\drag_gan.py", line 12, in <module>
    from stylegan2.model import Generator
  File "E:\000000000\DragGAN-main\stylegan2\model.py", line 8, in <module>
    from .op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d, conv2d_gradfix
  File "E:\000000000\DragGAN-main\stylegan2\op\__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "E:\000000000\DragGAN-main\stylegan2\op\fused_act.py", line 11, in <module>
    fused = load(
  File "C:\Program Files\Python39\lib\site-packages\torch\utils\cpp_extension.py", line 1284, in load
    return _jit_compile(
  File "C:\Program Files\Python39\lib\site-packages\torch\utils\cpp_extension.py", line 1508, in _jit_compile
    _write_ninja_file_and_build_library(
  File "C:\Program Files\Python39\lib\site-packages\torch\utils\cpp_extension.py", line 1600, in _write_ninja_file_and_build_library
    extra_ldflags = _prepare_ldflags(
  File "C:\Program Files\Python39\lib\site-packages\torch\utils\cpp_extension.py", line 1703, in _prepare_ldflags
    extra_ldflags.append(f'/LIBPATH:{_join_cuda_home("lib", "x64")}')
  File "C:\Program Files\Python39\lib\site-packages\torch\utils\cpp_extension.py", line 2230, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

Can you tell us if is a NVIDIA GPU is necessary to use DragGan ?

@Zeqiang-Lai
Copy link
Collaborator

Yes, you need GPU. It might be possible to run it with CPU, but it would be extremely slow and I didn't try it.

@Leonetienne
Copy link

Leonetienne commented May 23, 2023

I get this error aswell.
I have an NVIDIA gpu.
Stable diffusion runs fine on it on this install.
torch.cuda.is_available() returns true

i am using ubuntu

@Zeqiang-Lai
Copy link
Collaborator

I get this error aswell. I have an NVIDIA gpu. Stable diffusion runs fine on it on this install. torch.cuda.is_available() returns true

i am using ubuntu

You need CUDA installed to compile the custom ops of stylegan2.

Please refer to https://developer.nvidia.com/cuda-downloads

@Myzel394
Copy link

@Zeqiang-Lai I currently do not have a Nvidia GPU but was thinking about buying one. Do you have any recommendations for GPUs that work very well with your DragGAN implementation?

@Zeqiang-Lai
Copy link
Collaborator

Zeqiang-Lai commented May 25, 2023

@Zeqiang-Lai I currently do not have a Nvidia GPU but was thinking about buying one. Do you have any recommendations for GPUs that work very well with your DragGAN implementation?

I would recommend Nvidia 3090/4090 with 24GB video memory. They works perfect for me.

This implementation need a lot video memory, 9 GB at least for 1024x1024 pictures btw.

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

4 participants