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

pydarknet.is_compiled_with_gpu returns false #48

Closed
Harsharma2308 opened this issue Oct 27, 2018 · 6 comments
Closed

pydarknet.is_compiled_with_gpu returns false #48

Harsharma2308 opened this issue Oct 27, 2018 · 6 comments
Assignees

Comments

@Harsharma2308
Copy link

I have followed the steps to run with gpu and opencv. But on importing pydarknet,
Both pydarknet.is_compiled_with_gpu and pydarknet.is_compiled_with_opencv return False

@frfrrfrrr
Copy link

Same thing for me.
And pydarknet.set_cuda_device(0) returns:
module 'pydarknet' has no attribute 'set_cuda_device'

@dquig
Copy link

dquig commented Dec 28, 2018

I was running into the same issue trying to install from source with a custom darknet installation. It looks like the GPU environment variables is ignored if DARKNET_HOME is also set. T

if "GPU" in os.environ:

if "GPU" in os.environ:
    if "DARKNET_HOME" in os.environ:
        logging.warning("GPU environment variable is skipped since DARKNET_HOME is specified")
    else:
        if int(os.environ["GPU"]) == 1:
            logging.info("Darknet will be compiled with GPU support")
            USE_GPU = True
        else:
            logging.info("Darknet will be compiled without GPU support")
            USE_GPU = False

This causes pydarknet to be compiled without the ability to set cuda device.

IF USE_GPU == 1:

IF USE_GPU == 1:
--
64 | void cuda_set_device(int n)

It looks to me like the USE_GPU variable should still be set in the case that DARKNE_HOME is also set.

@madhawav madhawav self-assigned this Jan 4, 2019
@madhawav
Copy link
Owner

madhawav commented Jan 4, 2019

@dquig Thank you for showing the cause of issue. I will go through the setup script again and correct it.

@kartikpaigwar
Copy link

I am getting the same thing. Have you fixed that.
pydarknet.set_cuda_device(0) returns:
module 'pydarknet' has no attribute 'set_cuda_device'

@fspider
Copy link

fspider commented Jan 18, 2020

Hello. I am going to run several processes.. One on Gpu 1 and another one on GPU 2.
So i am going to use set_gpu_device() function.
But it is showing this error.

pydarknet.set_cuda_device(1)
AttributeError: module 'pydarknet' has no attribute 'set_cuda_device'

How can i do this?

@madhawav
Copy link
Owner

Fixed issue of ignoring GPU environment variable when custom DARKNET_HOME is set.
Refer #118

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

6 participants