FAQs
Installation and Licensing Configuration Related
Q: What is the reason for the error
invalid usernamewhen 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 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 FilesorInvalid 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
VERSIONin"license.dat"to confirm whether the major version is the same, if not, please go to the 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_licgenagain.
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
coptpyon 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
coptpyand Anaconda do not match. For example,coptpyis 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_licgencommand 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
.zshrcfile or.bash_profilefile, 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_licgento 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\copt80"), 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 theCdrive. Administrator privileges are not required to execute permission acquisition commands under user directories such as"C:\Users\copt80".
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 deniedis 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"inEnvrConfigbefore 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
NumPyis 1.23, and the minimum version requirement forPythonis 3.8 .NumPycan 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 12.0.1 for the CUDA library.
Q: Are there any requirements for the GPU architecture when enabling GPU solver?
A: The GPU architecture must be at least Maxwell or a more recent version. (Maxwell is a GPU architecture introduced by NVIDIA in 2014 as an upgrade to the earlier Kepler architecture.) Besides, COPT supports the Blackwell architecture for Windows and Linux platform.
Q: What are the common error messages and possible reasons when the machine cannot use COPT GPU solver?
A: Common error messages and possible reasons are as follows:
1.Solving log indicates
"CUDA libraries could not be loaded: cuBLAS cuSPARSE"which suggests that the listed necessary CUDA libraries 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 12.0.1 or above to resolve this issue.Q: On a client machine with multiple GPUs, when setting the parameter
GPUDeviceto 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.0.1 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.
Q: When solving with the GPU Barrier method, an error message
"GPU memory issue"is reported. How should I address this?A: This error is typically caused by insufficient GPU memory. Please try setting the parameter
GPUMode=1. If the issue persists, consider solving the model using the CPU (GPUMode=0).Q: When solving with the GPU Barrier method, a message says
"Performance may degenerate for GPUMode=2 on this problem, consider trying GPUMode=1 instead". What does this mean?A: This message indicates that the problem is still solvable, but using
GPUMode=2(high-performance mode) may result in longer solving time. You are advised to setGPUMode=1to solve the problem in the standard mode.
CPU and Memory Binding Related
Q: What is a NUMA node? How can I obtain the number of NUMA nodes in the operating system?
A: NUMA (Non-Uniform Memory Access) is a memory architecture designed for multi-processor systems. A NUMA node is the basic unit in this architecture, consisting of a group of CPU cores and the local memory directly attached to them. If the current machine has N physical CPUs, the return value of
env.getNumaNodeCount()will be N.Q: How can I solve a model using a specified NUMA node (CPU)?
A: If
env.getNumaNodeCnt()returns a value greater than 1, the machine contains multiple NUMA nodes. Since cross-node memory access is typically more expensive than access within the same node, you may callenv.bindNumaCpu(numaNode=n)to bind the solver to NUMA node n in order to reduce cross-node access overhead. ThenumaNodeargument starts from 0.Q: How can I bind memory to a specified NUMA node?
A: Similar to CPU binding, you may call
env.bindNumaMem(numaNode=0)to restrict memory allocation to the local memory of the specified NUMA node, thereby avoiding cross-node memory access.Q: How does
Envr.setCpuAffinity()specify the CPU cores used for solving? How should the argumenthexMaskbe interpreted?A:
hexMaskis a CPU mask represented as a hexadecimal string and used to specify the set of CPU cores available to the current process. After converting the mask to binary, bits are interpreted from right to left, corresponding to CPU core indices 0, 1, 2, and so on. A bit set to 1 indicates that the corresponding core is enabled for solving. For example, on a machine with 32 CPU cores, the callenv.setCpuAffinity("f1")uses the mask"f1", which corresponds to the binary1111 0001. Thus, CPU cores 0 and 4–7 will participate in solving.Q: How can I check which CPU cores are used by the current solving process?
A: You may call
env.getCpuAffinity()to retrieve the CPU affinity setting of the current solving process. It returns a list of core indices, such as[0, 4, 5, 6, 7]. If no CPU affinity is set, an empty list is returned, meaning the operating system determines the CPU scheduling.Q: What is the effective scope of CPU affinity set via
Envr.setCpuAffinity()?A: This function sets the CPU affinity for the current solving process. Once set, the affinity remains effective for the entire lifetime of the process and will not revert when
env.close()is called.