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

Invalid Gurobi license #299

Closed
nslosse opened this issue Mar 25, 2020 · 6 comments
Closed

Invalid Gurobi license #299

nslosse opened this issue Mar 25, 2020 · 6 comments

Comments

@nslosse
Copy link

nslosse commented Mar 25, 2020

Hello,

I have installed a fresh version of Gurobi.jl and JuMP for Julia Version 1.3.1 on a linux server.

When making call to Gurobi 9.0 from Julia, I bump on the following error message :

ERROR: LoadError: Invalid Gurobi license

After some research on the internet, I have checked that :

  • my Gurobi license file was valid (N.B. this is an evaluation licence)
  • all environment variable are properly set
  • gurobi works well on its own or when used embedded in python.

Do you have any idea what may cause this error ?

Thank you in advance,

Nicolas Slosse

@odow
Copy link
Member

odow commented Mar 25, 2020

Does your license support Gurobi 9.0? Did you set the GRB_LICENSE_FILE environment variable? You can check with ENV["GRB_LICENSE_FILE"].

From Gurobi.jl point of view, Gurobi.jl is installed and able to communicate with the binary.

@nslosse
Copy link
Author

nslosse commented Mar 26, 2020

Hi Odow, I confirm that both the environment variable is set that my license file is OK for gurobi 9.0, which I can run in standalone mode anyway.

After some tests, I did observe the following behaviour : I have launched a stand-alone gurobi task in the background and launched another gurobi model via Julia. Julia does crash at this instruction

model = Model(Gurobi.Optimizer)

Whereas without the Gurobi instance running, it would crash at this line

optimize!(model)

It's actually acting like Julia is making twice the gurobi license check. Maybe that causes the issue ?

Regards,

Nicolas

@odow
Copy link
Member

odow commented Mar 26, 2020

Oh. I missed the server part. You probably need to use https://github.com/JuliaOpt/Gurobi.jl#reusing-the-same-gurobi-environment-for-multiple-solves.

const env = Gurobi.Env()  # Do ONE license check
model = Model(() -> Gurobi.Optimizer(env))

@nslosse
Copy link
Author

nslosse commented Mar 26, 2020

Hi Odow,

Thanks, that was indeed the issue (I just got the same answer from the Gurobi's helpdesk).

Many thanks,

Nicolas

@odow
Copy link
Member

odow commented Mar 26, 2020

Glad you got it sorted.

@ccoffrin
Copy link

ccoffrin commented Sep 2, 2020

For anyone that may come across this thread, you may run into issues if running the same script multiple times, for example while doing model development. In that case, I have used the following approach for defining the env constant,

if !(@isdefined env)
    const env = Gurobi.Env()
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants