FAQs
Installation and Licensing Configuration Related
Q: What is the reason for the error
invalid username
when configuring the license?A: This error indicates that the username was incorrectly filled in when applying, and you can re-fill the form with the correct username to apply. For information on how to obtain username under different operating systems, please refer to the Solver COPT application page, please remark in the application reason with “The username is incorrectly filled in, reapply” . we will issue new license for the correct username.
Q: After downloading COPT, an antivirus software installed on the computer reports a virus and automatically isolates it.
A: The COPT software downloaded from the COPT official download link is the official version, which has not been developed with any suspicious virus behavior. It can be determined that the anti-virus software is falsely reporting. Please temporarily close the anti-virus software before downloading it.
Q: After validating the license (executing
copt_licgen -v
), it reports an error:Missing Files
orInvalid Signature
.A: This type of error indicates that the license file configuration fails. Please refer to Installation Instructions: Configuring License File to check whether the steps for configuring the license file are correctly followed. Common reasons are as follows:
The license file in the current working directory is not compatible with the version of COPT (for example: the license is version 4.0, while the COPT is version 5.0), please check the
VERSION
in"license.dat"
to confirm whether the major version is the same, if not, please go to the Solver COPT application page to re-apply, and we will issue you the latest license.In Windows system, if the COPT software is installed in the system disk (usually
C
) in a non-user directory (eg: the default installation path"C:\Program Files\copt70"
) , you need to open the command line window with administrator privileges and execute the license acquisition commandcopt_licgen
again.
Q: I have already installed an old version of the COPT Python interface (
coptpy
), how do I upgrade to the new version?A: Please refer to Python Interface Quick Start: Upgrade to the newer version for detailed steps.
MacOS System
Q: When calling
coptpy
on MacOS, an error is reported:ImportError: from .coptpywrap import * symbol not found in flat namespace
.A: This error may occur before COPT 6.5.12, since the architecture of
coptpy
and Anaconda do not match. For example,coptpy
is the M chip version (arm64), and Anaconda is x86 version, you could install Anaconda that supports arm64 architecture to solve this problem.However, from COPT 6.5.12, for MacOS systems, we provide universal package, so this problem could be resolved by upgrading COPT to the latest version.
Q: When the license is configured in the MacOS system, the
copt_licgen
command is executed in the terminal, and an error is reported:command not found: copt_licgen
.A: This error is because the relevant environment variables of COPT are not configured. In the MacOS system, you need to configure the environment variables after installing COPT. Please refer to Installation Instructions: MacOS System chapter to obtain detailed installation instructions.
Q: When manually configuring environment variables, I copy content directly from the document to
.zshrc
file or.bash_profile
file, causing the configuration to fail.A: Due to the document encoding problem, the above environment variables cannot be directly copied to the corresponding file, and the contents of the environment variables need to be manually entered.
Windows System
Q: In Windows system, when executing
copt_licgen
to generate the license file, an error is reported that the license file cannot be written to the hard disk, and the error message is:error opening file
.A: If the COPT software is installed in the system disk (usually
C
) in a non-user directory (eg: the default installation path"C:\Program Files\copt70"
), y you need to open the command line window with administrator privileges and execute the license acquisition commandcopt_licgen
, in order to normally write the license file to theC
drive. Administrator privileges are not required to execute permission acquisition commands under user directories such as"C:\Users\shanshu"
.
Q: In Windows system, when installing COPT Python interface via command
pip install coptpy
, an error is displayed:could not find a version, no matching distribution
, what is the reason?A: Please do not use Python installed through Microsoft Store, it is recommended to download from Anaconda distribution or Python official distribution Download Python.
Q: In Windows system, when installing COPT Python interface through COPT installation package (
python setup.py install
), an errorcould not create build: access denied
is reported.A: If COPT is installed in the system disk (usually
C
) in a non-user directory (eg: the default installation path"C:\Program Files\copt70"
), you need to first Open the command line window with administrator privileges and execute the commandpython setup.py install
.
Modeling and Solving Functions Related
Q: When creating a COPT solution environment, two lines of version information will be output. If I want to turn off this information, how should I do it?
A: You can turn it off by setting
"nobanner"
to"1"
inEnvrConfig
before creating the solution environment. Taking the Python API as an example, the specific operations are as follows:envconfig = coptpy.EnvrConfig() envconfig.set('nobanner', '1') env = coptpy.Envr(envconfig) model = env.createModel()
Q: How to deal with the situation where the model is infeasible?
A: COPT provides functions to calculate IIS and feasible relaxation to analyze the reasons for model infeasibility: Computing IIS will obtain the minimum set of infeasible constraints and variables, and feasibility relaxation attempts to make the model feasible with minimal changes.
Q: Are there default value ranges for variables created in COPT?
A: Yes, the default lower bound of variables in COPT is 0, and the upper bound is
COPT.INFINITY
. Users can specify the lower bound of variables through the function argument lb, and the upper bound of variables through ub.Q: What is the reason for the error
ValueError: cannot create object arrays from iterator.
when adding matrix variables using the matrix modeling method of COPT?A: The matrix modeling function supported by COPT Python has a minimum version requirement, the minimum version requirement for
NumPy
is 1.23, and the minimum version requirement forPython
is 3.8 .NumPy
can be upgraded to the latest version bypip install --upgrade numpy
.Q: When adding constraints using Python interface, if the modeling efficiency is slow, are there any ways to improve the modeling process?
A: The Python interface of COPT supports building linear expression, quadratic expression and PSD expression in natural way. For linear and quadratic expression, it is recommended to use quicksum() to build expression objects. For linear and PSD expression, it is recommended to use psdquicksum() to build expression objects. Both of them implement inplace summation, which is much faster than standard plus operator.
GPU Usage Related
Q: Are there any requirements for the CUDA library version when enabling COPT’s GPU solver?
A: COPT requires a minimum version of 11.7 for the CUDA library. We recommend installing CUDA 12.0 or above, which can be directly installed via the official installer. If you need to install CUDA version 11, the best practice is to separately install CUDA Driver and CUDA Toolkit:
Firstly, please download and install CUDA Driver separately (for Linux systems, CUDA Driver requires a minimum version of 525.60.13, for Windows systems, CUDA Driver requires a minimum version of 527.41).
Secondly, please download the official CUDA installer with version 11.7 or above and only install the CUDA Toolkit, without selecting CUDA driver.
Q: Are there any requirements for the GPU architecture when enabling GPU solver?
A: The GPU architecture needs to be at least the Maxwell architecture or above (Maxwell architecture is a GPU architecture introduced by NVIDIA in 2014, an upgrade from its previous Kepler architecture).
Q: What are the common error messages and possible reasons when the machine cannot use GPU solver?
A: Common error messages and possible reasons are as follows:
1.Solving log indicates
"NO CUDA libraries available"
which suggests that necessary CUDA library functions are missing. You could try checking and setting the environment variable"LD_LIBRARY_PATH"
to point to the directory where CUDA is installed. (Please follow the instructions provided after CUDA installation. Environment variables are automatically configured during installation on Windows systems. For Linux systems, manual configuration of environment variables is typically required. The directory will be like:"/usr/local/cuda/lib64"
).2.Solving error message
"Fail to solve problem"
is usually due to the lower version of CUDA Driver. Please upgrade the COPT Driver (for Linux systems: 525.60.13 or above; for Windows systems: 527.41 or above) to resolve this issue.3.Solving error message
"sparse matrix format CUSPARSE_FORMAT_CSC is not supported"
is usually caused by the lower version of CUDA Toolkit (typically occurring between CUDA V11.2 and V11.6). Please upgrade CUDA to version 11.7 or above to resolve this issue.Q: On a client machine with multiple GPUs, when setting the parameter GPUDevice to use a specific GPU number, why does it still detect only GPU with number 0 during solving?
A: Please check if the environment variable
"CUDA_VISIBLE_DEVICES"
has been manually set to specify the visible GPU devices for CUDA. Try not to set this environment variable so that COPT can detect all available GPUs on the current machine.Q: Why do I encounter errors when using COPT’s GPU solver via Windows Subsystem for Linux (WSL) despite installing CUDA libraries that meet the version requirements (V12 or higher)?
A: Please check if the CUDA Driver version meets the requirements. WSL usually skips the Driver installation when installing CUDA and directly uses the Driver already installed in Windows. Please manually upgrade the CUDA Driver version and then restart WSL to resolve this issue.