7 Commits
Author SHA1 Message Date
Jamie LiuandgVisor bot d7996a5d9b Remove "AddressSpace activation".
PiperOrigin-RevId: 869302553
2026-02-12 14:55:06 -08:00
Jamie LiuandgVisor bot 134f74b24b Add support for nvidia-imex.
- Add /proc/devices.

- Provide /proc/driver/nvidia/params when nvproxy is enabled. CUDA-using
  applications already try to open this file, but silently tolerate its
  non-existence. However, both the IMEX daemon and IMEX-using applications are
  believed to require this file for ImexChannelCount. (libnvidia-container
  additionally provides /proc/driver/nvidia/{registry,version}, but we have yet
  to see any application use these.)

- Add new capability nvconf.CapFabricIMEXManagement. When enabled, provide
  /proc/driver/nvidia/capabilities/fabric-imex-mgmt and the corresponding
  /dev/nvidia-caps/nvidia-cap#.

- Add support for /dev/nvidia-caps-imex-channels/ (irrespective of the new
  capability, since IMEX-using applications need this directory as well).

- Allow devutil.GoferClient.OpenAt() to take a relative path (i.e. containing
  more than one path component) rather than only a basename, since this is
  needed to open /dev/nvidia-caps/*.

- Add nvproxy support for all known-required controls, and all allocation
  classes to which those controls correspond.

This CL is specifically for nvidia-imex, the "NVIDIA IMEX Service for NVLink
Networks" (or "IMEX daemon"); applications using IMEX haven't been tested yet,
and may require additional allocation classes / control commands, or some
existing ones marked as requiring CapFabricIMEXManagement as being enabled more
broadly.

PiperOrigin-RevId: 859286209
2026-01-21 15:25:28 -08:00
Jamie LiuandgVisor bot 021c31a619 Internal change
PiperOrigin-RevId: 631677570
2024-05-08 00:09:42 -07:00
Ayush RanjanandgVisor bot 250ffb3f56 Add GoferClientProvider to devutil.
Also introduce CtxDevGoferClientProvider, which is provided in restore context.

PiperOrigin-RevId: 631237657
2024-05-06 17:37:13 -07:00
Ayush RanjanandgVisor bot 13a6afd171 Save container name in nvproxy FDs.
PiperOrigin-RevId: 630626291
2024-05-04 03:10:56 -07:00
Ayush RanjanandgVisor bot 7cf484127d Move GPU device ownership to gofer process.
Tested on a T4 GPU with driver version 525.60.13:
```
$ docker run --runtime=runsc --gpus=all --rm -it nvcr.io/nvidia/k8s/cuda-sample:vectoradd-cuda11.7.1-ubi8
[Vector addition of 50000 elements]
Copy input data from the host memory to the CUDA device
CUDA kernel launch with 196 blocks of 256 threads
Copy output data from the CUDA device to the host memory
Test PASSED
Done
```

Also tested this on GKE with the same vectoradd workload. Checked that the
device gofer connection is actually being closed when the container is deleted.
Something to note is that the gofer logs for the GPU-container sometimes end
abruptly (the "All lisafs servers exited." line does not print). This is
because runsc/container/container.go:stop() SIGKILLs the gofer before it can
cleanup naturally. The device gofer connection is only closed at the end of
Loader.destroySubcontainer(), which gives little time before the gofer is
SIGKILL-ed.

PiperOrigin-RevId: 581365665
2023-11-10 14:20:31 -08:00
Ayush RanjanandgVisor bot 8a20356084 Add device gofer connection.
Adds a gofer connection for /dev directory on the gofer when GPU functionality
is requested. This gofer connection is currently unused. The gofer client is
owned by the kernel, which injects the connection into the context. The gofer
connection is closed on container exit. S/R should be supported with this.

PiperOrigin-RevId: 581298536
2023-11-10 10:22:54 -08:00