Adds device, ioctls, and new CapProfiling capability#13008
Open
copybara-service[bot] wants to merge 1 commit intomasterfrom
Open
Adds device, ioctls, and new CapProfiling capability#13008copybara-service[bot] wants to merge 1 commit intomasterfrom
copybara-service[bot] wants to merge 1 commit intomasterfrom
Conversation
03b5a5c to
f2874f9
Compare
This makes changes to support [Nsight](https://developer.nvidia.com/tools-overview), a suite of NVIDIA tools to profile GPU workloads, including: - adds missing classes and ioctls - adds new "unsafe" function `ctrlGpuExecRegOps` - adds new capability, `CapProfiling` In order to mitigate side-channel attacks when exposing the same GPU to two different containers (see "Rendered Insecure: GPU Side Channel Attacks Adds nsight ioctls are Practical" [1]), I am adding a new capability: `CapProfiling`. This follows the implementation from `CapFabricIMEXManagement` and needs to explicitly added with `--nvproxy-allowed-driver-capabilities=all,profiling`. This also adds the "unsafe" function `ctrlGpuExecRegOps`. This is the case because `NV2080_CTRL_GPU_EXEC_REG_OPS_PARAMS` contains an `NvP64` pointer (`RegOps`) to an array of register operations in the application's address space. `ctrlGpuExecRegOps` copies this array into sentry memory and rewrites the pointer before forwarding to the host, then copies results back. This behavior follows existing nvproxy pattern for ioctls with embedded pointers (e.g. `ctrlGetNvU32List`). (The parity test also explicitly checks that structs with `NvP64` fields are not registered as simple ioctls. Hence the custom handler that copies the `regOps` array through sentry memory seems the correct approach.) [1] https://www.cs.ucr.edu/~zhiyunq/pub/ccs18_gpu_side_channel.pdf FUTURE_COPYBARA_INTEGRATE_REVIEW=#12945 from luiscape:add-profiling-support ac83604 PiperOrigin-RevId: 905190979
f2874f9 to
d83bcb5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds device, ioctls, and new CapProfiling capability
This makes changes to support Nsight, a suite of NVIDIA tools to profile GPU workloads, including:
ctrlGpuExecRegOpsCapProfilingIn order to mitigate side-channel attacks when exposing the same GPU to two different containers (see "Rendered Insecure: GPU Side Channel Attacks Adds nsight ioctls are Practical" [1]), I am adding a new capability:
CapProfiling. This follows the implementation fromCapFabricIMEXManagementand needs to explicitly added with--nvproxy-allowed-driver-capabilities=all,profiling.This also adds the "unsafe" function
ctrlGpuExecRegOps. This is the case becauseNV2080_CTRL_GPU_EXEC_REG_OPS_PARAMScontains anNvP64pointer (RegOps) to an array of register operations in the application's address space.ctrlGpuExecRegOpscopies this array into sentry memory and rewrites the pointer before forwarding to the host, then copies results back. This behavior follows existing nvproxy pattern for ioctls with embedded pointers (e.g.ctrlGetNvU32List).(The parity test also explicitly checks that structs with
NvP64fields are not registered as simple ioctls. Hence the custom handler that copies theregOpsarray through sentry memory seems the correct approach.)[1] https://www.cs.ucr.edu/~zhiyunq/pub/ccs18_gpu_side_channel.pdf
FUTURE_COPYBARA_INTEGRATE_REVIEW=#12945 from luiscape:add-profiling-support ac83604