nvidia-cuda-mps-control(1)
π nvidia-cuda-mps-control(1) π
okay bestie, gather round, because this is the NVIDIA CUDA Multi Process Service management program β yes that's the manual name, it lives in section 1 of the NVIDIA man pages, and it is lowkey the glow-up your MPI processes have been begging for. β¨
πΈ SYNOPSIS πΈ
nvidia-cuda-mps-control [-d | -f]
that's it. that's the whole synopsis. two flags. iconic. π
π¦ DESCRIPTION π¦
so MPS is a runtime service, right, and its whole thing is letting multiple MPI processes that use CUDA run concurrently in a way that's completely transparent to the MPI program. like the MPI program doesn't even know. no cap. A CUDA program runs in MPS mode if the MPS control daemon is running on the system.
here's the tea on what actually happens when CUDA initializes in a program for the first time: the CUDA driver tries to connect to the MPS control daemon.
- if that connection attempt fails, the program just keeps running as it normally would, no MPS, no drama, we move on π«Ά
- if the connection attempt succeeds, the CUDA driver asks the daemon to start an MPS server on its behalf
and then it gets spicy:
- if there's already an MPS server running and the user id of that server process matches the requesting client process, the control daemon just tells the client about it, and the client goes and connects to the server. simple. π
- if there's no MPS server running yet, the control daemon launches one with the same user id (UID) as the requesting client process
- if there's an MPS server running but with a different user id than the client process, the control daemon asks that existing server to shut down as soon as all its clients are done. once it's actually terminated, the control daemon launches a fresh server with the same user id as the queued client process
The MPS server is the one creating the shared GPU context and managing all its clients. and here's the thing β an MPS server can only support a finite amount of CUDA contexts, and the limit depends on the hardware architecture it's running on:
- compute capability SM 3.5 through SM 6.0 β the limit is 16 clients per GPU at a time
- compute capability SM 7.0 β limit is 48 π
MPS is transparent to CUDA programs, with literally all the complexity of communication between the client process, the server and the control daemon hidden away inside the driver binaries. you don't see it, you don't touch it. π§
Currently, CUDA MPS is available on 64-bit Linux only, requires a device that supports Unified Virtual Address (UVA) and has compute capability SM 3.5 or higher. Applications requiring pre-CUDA 4.0 APIs are not supported under CUDA MPS. Certain capabilities are only available starting with compute capability SM 7.0.
refer to the MPS documentation on NVIDiA Docs for more details, bestie. i'm giving you the vibe, they're giving you the lore.
β¨ OPTIONS β¨
-dβ start the MPS control daemon in background mode, assuming the user has enough privilege (e.g.root). the parent process exits once the control daemon has started listening for client connections. bye parent π-fβ start the MPS control daemon in foreground mode, assuming the user has enough privilege (e.g.root). debug messages get sent to standard output, so you can watch everything happen live. main character energy π₯-h,--helpβ print a help message. we love a helpful icon.<no arguments>β start the front-end management user interface to the MPS control daemon, which needs to be started first. the front-end UI keeps reading commands fromstdinuntilEOF. Commands are separated by the newline character. If an invalid command is issued and rejected, an error message will be printed tostdout. The exit status of the front-end UI is zero if communication with the daemon is successful. A non-zero value is returned if the daemon is not found or connection to the daemon is broken unexpectedly. See the"quit"command below for more information about the exit status.
π Commands supported by the MPS control daemon π
get_server_listβ Print out a list of PIDs of all MPS servers.get_server_status PIDβ Print out the status of the server with given (PID).start_server -uid UIDβ Start a new MPS server for the specified user (UID).shutdown_server PID [-f]β Shutdown the MPS server with givenPID. MPS server only exits after all clients disconnect, and the MPS server may accept new clients while there is a connected client.-fis forced immediate shutdown. If a client launches a faulty kernel that runs forever, a forced shutdown of the MPS server may be required, since the MPS server creates and issues GPU work on behalf of its clients. πget_client_list PIDβ Print out a list of PIDs of all clients connected to the MPS server with givenPID.quit [-t TIMEOUT]β Shutdown the MPS control daemon process and all MPS servers. The MPS control daemon stops accepting new clients while waiting for current MPS servers and MPS clients to finish. IfTIMEOUTis specified (in seconds), the daemon will force MPS servers to shutdown if they are still running afterTIMEOUTseconds.
This command is synchronous. The front-end UI waits for the daemon to shutdown, then returns the daemon's exit status. The exit status is zero iff all MPS servers have exited gracefully.
π Commands available to Volta MPS control daemon π
get_device_client_list PIDβ List the devices and PIDs of client applications that enumerated this device. It optionally takes the server instance PID.set_default_active_thread_percentage percentageβ Set the default active thread percentage for MPS servers. If there is already a server spawned, this command will only affect the next server. The set value is lost if aquitcommand is executed. The default is100.get_default_active_thread_percentageβ Query the current default available thread percentage.set_active_thread_percentage PID percentageβ Set the active thread percentage for the MPS server instance of the givenPID. All clients created with that server afterwards will observe the new limit. Existing clients are not affected.get_active_thread_percentage PIDβ Query the current available thread percentage of the MPS server instance of the givenPID.set_default_device_pinned_mem_limit dev valueβ Sets the default device pinned memory limit for for the MPS servers. If there is already a server spawned, this command will only affect the next server. The value must be in the form of an integer followed by a qualifier, either βGβ or βMβ that specifies the value in Gigabytes or Megabytes respectively.get_default_device_pinned_mem_limit devβ Query the current default pinned memory limit for the device.set_device_pinned_mem_limit PID dev valueβ Overrides the device pinned memory limit for the MPS server of the givenPID. All the clients created with that server afterwards will observe the new limit. Existing clients are not affected.get_default_device_pinned_mem_limit PID devβ Query the current device pinned memory limit of the MPS server instance of the givenPIDfor the devicedev.terminate_client server PID client PIDβ Terminates all the outstanding GPU work of the MPS client process of the given client PID running on the MPS server denoted by<server PID>.ps [-p PID]β Reports a snapshot of the current client processes.set_default_client_priority priorityβ Set the client priority level that will be used for new clients. Priority values are only considered as hints to the CUDA driver and can be ignored or overridden depending on platform.priorityfollows a convention where smaller numbers are higher priorities, and the default priority value is0. The only other supported value forpriorityis1, which represents a below-normal priority level.get_default_client_priorityβ Query the current priority value that will be used for new clients.
π ENVIRONMENT π
CUDA_MPS_PIPE_DIRECTORYβ Specify the directory that contains the named pipes and UNIX domain sockets used for communication among the MPS control, MPS server, and MPS clients. The value of this environment variable should be consistent in the MPS control daemon and all MPS client processes. Default directory is/tmp/nvidia-mpsCUDA_MPS_LOG_DIRECTORYβ Specify the directory that contains the MPS log files. This variable is used by the MPS control daemon only. Default directory is/var/log/nvidia-mpsCUDA_VISIBLE_DEVICESβ Specify which CUDA devices are visible to the control daemon. Takes either an index value or UUID.CUDA_DEVICE_MAX_CONNECTIONSβ Specify the preferred number of connections between the host and device.CUDA_MPS_ACTIVE_THREAD_PERCENTAGEβ Specify the portion of available threads that clients can use on Volta+ hardware. Setting this for the control daemon will set the default active thread percentage for all servers spawned, while setting this for a client or client context will constrain the active thread percentage for that unit and cannot be higher than the active thread percentage value set for the control daemon.CUDA_MPS_ENABLE_PER_CTX_DEVICE_MULTIPROCESSOR_PARTITIONINGβ Specify whether individual client contexts are allowed to have different values forCUDA_MPS_ACTIVE_THREAD_PERCENTAGE.CUDA_MPS_PINNED_DEVICE_MEM_LIMITβ Specify the amount of GPU memory available to MPS client processes.CUDA_MPS_CLIENT_PRIORITYβ Specify the default client priority value at initialization.
π FILES π
Log files created by the MPS control daemon in the specified directory:
control.logβ Record startup and shutdown of MPS control daemon, user commands issued with their results, and status of MPS servers.server.logβ Record startup and shutdown of MPS servers, and status of MPS clients.
and that's the whole page, bestie. every flag, every command, every env var, every log file, all present and accounted for. iykyk π
nvidia-cuda-mps-control β that's the source/version vibe right there β 2013-02-26, section nvidia-cuda-mps-control(1). stay slaying, and may all your MPS servers exit gracefully. π«Άβ¨π
π¦ where this page comes from
- debian trixie: nvidia-cuda-mps 550.163.01-2 Β· zlib/libpng
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms