Skip to content

Adds device, ioctls, and new CapProfiling capability#13008

Open
copybara-service[bot] wants to merge 1 commit intomasterfrom
test/cl905190979
Open

Adds device, ioctls, and new CapProfiling capability#13008
copybara-service[bot] wants to merge 1 commit intomasterfrom
test/cl905190979

Conversation

@copybara-service
Copy link
Copy Markdown

Adds device, ioctls, and new CapProfiling capability

This makes changes to support Nsight, 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

@copybara-service copybara-service Bot added the exported Issue was exported automatically label Apr 24, 2026
@copybara-service copybara-service Bot force-pushed the test/cl905190979 branch 2 times, most recently from 03b5a5c to f2874f9 Compare April 24, 2026 21:27
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant