aboutsummaryrefslogtreecommitdiffstats
path: root/nvtaskset.c
Commit message (Collapse)AuthorAge
* Speed up nvtaskset by skipping CUDA context creation if possibleJoshua Bakita2025-06-25
| | | | | | | | | | | | | | | | | | The GPU needs to be on before the GPC-to-TPC mapping registers can be read. The easiest way to power on the GPU is to create a CUDA context, but this is fairly expensive. In nvtaskset, some GPU-using task will likely already be running, and so we can skip CUDA context creation in the common case. Bug fixes: - Delete the temporary CUDA context created by nvtaskset after it is done with it. Fixes bug where nvtaskset would leak this context into any program it launches. Additional changes: - Style fixes in libsmctrl.c - Remove superfluous newlines from error() calls in nvtaskset.c
* Rewrite nvtaskset and implementation of partitioning for unmodified tasksJoshua Bakita2025-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than requiring libsmctrl.so to be preloaded, we now wrap libcuda.so.1. All CUDA-using applications will load libcuda.so.1, ensuring that our wrapper will always be dynamically loaded, no matter if LD_PRELOAD is enabled, or if a program has been staticly linked. All that needs to be done is that the location of our "fake" libcuda.so.1 need to be put within the loader search path. This can be done by setting LD_LIBRARY_PATH, or by installing our wrapper into /lib/x86_64-linux-gnu. The mask can still be set via the LIBSMCTRL_MASK environment variable, but the easier-to-use nvtaskset tool is now the recommended way to view or change the supreme TPC mask for any CUDA-using application. This allows launching a program on the first two GPCs via a command as simple as: ./nvtaskset -g 0-1 ./a_program a_program_args (Note that use of the -g option requires the nvdebug kernel module to first be loaded.) These changes support the final version of the ECRTS'25 paper. Note that nvtaskset does not yet fully support multi-GPU systems. Bugfixes: - Fix crash that would occur if both libsmctrl.so and libsmctrl.a were built into an application. - Correctly use GPU ID when initializing a context in `libsmctrl_test_gpc_info`. - Include `nvtaskset` as a prerequisite for `libsmctrl_test_supreme_mask`. - Fix malfunction of `libsmctrl_test_gpc_info` if CUDA_VISIBLE_DEVICES is set. Other minor changes: - Adds make target to run all the tests. - Fixes typos in comments. - Enables -Wall build option. - Upgrades supreme mask from 64 to 128 bits. - Removes `detect_parker_soc()` from the global namespace. - Adjusts test messages to be more succinct. - Updates README with overview of how to partition unmodified applications, more details on the tests, and information on the new ECRTS'25 paper.
* Correct how path of libsmctrl.so is specified in LD_PRELOAD by nvtasksetJoshua Bakita2025-05-20
| | | | | Indicate that the loader should search the standard library paths by ommiting the "./" prefix.
* Major update for ECRTS'25: fix TPC to GPU mapping and add a "supreme" maskJoshua Bakita2025-05-09
These updates are featured in the paper: J. Bakita and J. H. Anderson, “Hardware Compute Partitioning on NVIDIA GPUs for Composable Systems”, Proceedings of the 37th Euromicro Conference on Real-Time Systems (ECRTS), to appear, Jul 2025. They: 1. Fix reported GPC to TPC mappings (requires nvdebug update). 2. Add support for a "supreme" mask, which overrides all others and can be set on a per-process basis via an environment variable, and optionally modified at runtime via the nvtaskset utility. 3. Add test for the supreme mask.