Adds device, ioctls, and new CapProfiling capability#12945
Open
luiscape wants to merge 1 commit intogoogle:masterfrom
Open
Adds device, ioctls, and new CapProfiling capability#12945luiscape wants to merge 1 commit intogoogle:masterfrom
luiscape wants to merge 1 commit intogoogle:masterfrom
Conversation
Contributor
Author
|
@ayushr2 took a bit of liberty here adding |
125f5b2 to
321eddc
Compare
ayushr2
reviewed
Apr 22, 2026
321eddc to
1083a59
Compare
Contributor
Author
|
@ayushr2 thank you for your review. I removed |
ayushr2
reviewed
Apr 24, 2026
ayushr2
reviewed
Apr 24, 2026
This adds ioctls and classes to support Nsight, a suite of NVIDIA tools to profile GPU workloads. 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`. [1] https://www.cs.ucr.edu/~zhiyunq/pub/ccs18_gpu_side_channel.pdf
1083a59 to
ac83604
Compare
Contributor
Author
|
@ayushr2 thank you so much. I applied all changes. |
ayushr2
approved these changes
Apr 24, 2026
copybara-service Bot
pushed a commit
that referenced
this pull request
Apr 24, 2026
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
copybara-service Bot
pushed a commit
that referenced
this pull request
Apr 24, 2026
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
copybara-service Bot
pushed a commit
that referenced
this pull request
Apr 24, 2026
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
ayushr2
reviewed
Apr 25, 2026
| nvgpu.NVB0CC_CTRL_CMD_UNBIND_PM_RESOURCES: simpleIoctlInfo("NVB0CC_CTRL_CMD_UNBIND_PM_RESOURCES"), | ||
| nvgpu.NVB0CC_CTRL_CMD_PMA_STREAM_UPDATE_GET_PUT: simpleIoctlInfo("NVB0CC_CTRL_CMD_PMA_STREAM_UPDATE_GET_PUT", "NVB0CC_CTRL_PMA_STREAM_UPDATE_GET_PUT_PARAMS"), | ||
| nvgpu.NVB0CC_CTRL_CMD_EXEC_REG_OPS: simpleIoctlInfo("NVB0CC_CTRL_CMD_EXEC_REG_OPS", "NVB0CC_CTRL_EXEC_REG_OPS_PARAMS"), | ||
| nvgpu.NVB0CC_CTRL_CMD_RESERVE_PM_AREA_PC_SAMPLER: simpleIoctlInfo("NVB0CC_CTRL_CMD_RESERVE_PM_AREA_PC_SAMPLER", "NVB0CC_CTRL_RESERVE_PM_AREA_PC_SAMPLER_PARAMS"), |
Collaborator
There was a problem hiding this comment.
Submit is failing (https://buildkite.com/gvisor/pipeline/builds/41744) because NVB0CC_CTRL_RESERVE_PM_AREA_PC_SAMPLER_PARAMS does not exist in the driver. I think this control command does not have any params: https://github.com/NVIDIA/open-gpu-kernel-modules/blob/db0c4e65c8e34c678d745ddb1317f53f90d1072b/src/nvidia/generated/g_profiler_v2_nvoc.c#L290
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.
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