28 Commits
Author SHA1 Message Date
Ayush RanjanandgVisor bot 6b4f0082c2 nvproxy: Add support for AMPERE_A, ADA_A, HOPPER_A.
TURING_A was added in e6e1ecbdcc ("Add support for graphics in nvproxy.").
{GPU_ARCH}_A class is used for graphics workloads. Add the missing classes for
other GPU architectures we support.

PiperOrigin-RevId: 726620575
2025-02-13 13:45:12 -08:00
1a9abee80b nvproxy: Add support for 570.86.15 driver.
Co-authored-by: Zach Koopmans <zkoopmans@google.com>
PiperOrigin-RevId: 721910920
2025-01-31 14:53:49 -08:00
2022tgoel 7399a32b4c Add GPU video codecs support to nvproxy (so that tools like ffmpeg work)
adding cap

tests work

fix merge

unit test

small fixes

additional ioctls for L4 gpu
2025-01-09 01:09:47 +00:00
Ayush RanjanandgVisor bot b11efeaecd nvproxy: Clean up struct field tags.
Before this change, there were 2 places in which the driver struct names were
defined for nvproxy structs:
1. As struct field tags. The first field of structs had a tag `nvproxy:*`. This
   was kind of awkward. Such metadata is usually a struct comment.
2. In version.go while registering the struct with a name. Not all structs are
   defined in nvproxy (for example simple structs). In such cases, the driver
   struct name is directly assigned while registering struct info.

This change gets rid of (1). Most of the struct tags were `nvproxy:"same"`. Now
driverStructs() always infers the driver struct name using the nvproxy struct
name itself. The few cases where the nvproxy tag was needed, because driver
struct name was lower cased, were handled by defining driverStructWithName()
which allows specifying a different name. Now all driver struct names
definitions are in one place.

Along the way, also made the following fixes:
- For some reason, many structs defined in pkg/abi/nvgpu/frontend.go had
  camel-cased naming, while all other structs in pkg/abi/nvgpu/ctrl.go and
  pkg/abi/nvgpu/classes.go were named the same as their driver structs. The
  convention in the abi/* packages is to follow the kernel source naming.
  This is against Go sytle guide, but is more readable for gVisor purposes and
  has been a long accepted convention. This also makes the task of removing (1)
  easier. So renamed all such structs as per their driver names.
- A lot of code in pkg/sentry/devices/nvproxy/version.go was still referring to
  driver struct info as "struct names", even though it was representing more
  than just struct names. It also contains the reflect.Type of the struct which
  is used to compare the nvproxy struct layout to the driver struct layout.

PiperOrigin-RevId: 710648105
2024-12-30 01:32:41 -08:00
Ayush RanjanandgVisor bot e6e1ecbdcc Add support for graphics in nvproxy.
PiperOrigin-RevId: 708100465
2024-12-19 17:41:18 -08:00
Jamie LiuandgVisor bot 01e30ab09b nvproxy: don't depend on HVASpace for non-virtmem NVOS32_FUNCTION_ALLOC_SIZE
PiperOrigin-RevId: 704780681
2024-12-10 11:26:47 -08:00
Nathan Wang 4b1db872bd nvproxy: Add GF100_PROFILER allocation class and NV2080_CTRL_CMD_TIMER_SET_GR_TICK_FREQ control command 2024-09-27 20:03:57 +00:00
Anthony CuiandgVisor bot 34f8c3f24e Fix inconsistencies with nvproxy ioctl structs compared to the Nvidia driver.
This adds specific handling for NV0000_CTRL_GPU_GET_ID_INFO_PARAMS and
NV0000_CTRL_SYSTEM_GET_P2P_CAPS_PARAMS since they contain pointer fields.
This also fixes the layout of NV0000_CTRL_OS_UNIX_GET_EXPORT_OBJECT_INFO_PARAMS
and NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS, and the typing of fields for
NV0000_CTRL_OS_UNIX_EXPORT_OBJECT and UVM_MAP_EXTERNAL_ALLOCATION_PARAMS.

PiperOrigin-RevId: 659630154
2024-08-05 11:54:06 -07:00
Anthony CuiandgVisor bot ced5d60576 Record driver struct names within nvproxy.
This is a necessary addition to enable our Nvidia driver differ tool, and
in general to make it easier to keep nvproxy up to date with driver changes.

The current maps have been partially validated by the test in cl/655637570.

PiperOrigin-RevId: 657705274
2024-07-30 13:16:27 -07:00
Ayush RanjanandgVisor bot e2f328e234 Add support for missing ioctls used by Triton Interface Server.
PiperOrigin-RevId: 654886437
2024-07-22 14:04:43 -07:00
gVisor bot e87ab0a301 Merge pull request #10649 from thundergolfer:master
PiperOrigin-RevId: 652526851
2024-07-15 10:35:51 -07:00
Jonathon Belotti d3d19f12c5 nvproxy: implement missing NV_MEMORY_MULTICAST_FABRIC, NV00FD_* 2024-07-12 21:03:46 +00:00
Jamie LiuandgVisor bot 617a184cf2 nvproxy: implement and use fmt.Stringer.String for handles and class IDs
This makes logging slightly more consistent and less verbose (don't need
`h.Val` to avoid extraneous braces in the output), and improves type safety for
class IDs.

PiperOrigin-RevId: 624316076
2024-04-12 15:57:19 -07:00
gVisor bot d554cabf9a Merge pull request #9997 from derpsteb:h100-cc-mode-clean
PiperOrigin-RevId: 621276476
2024-04-02 13:30:10 -07:00
Ayush RanjanandgVisor bot 8f1f1339bf Add support for 550.54.14 driver in nvproxy.
PiperOrigin-RevId: 617535894
2024-03-20 09:25:16 -07:00
Ayush RanjanandgVisor bot 09f56c1f1e Deprecate nvproxy support for driver versions <535.104.05.
See policy in https://gvisor.dev/docs/user_guide/gpu/#driver-versions.

PiperOrigin-RevId: 615557658
2024-03-13 15:13:30 -07:00
Ayush RanjanandgVisor bot 8841a6e25c Add support for Stable Diffusion XL in nvproxy.
Tested on T4 GPU using image gcr.io/gvisor-presubmit/gpu/stable-diffusion-xl.

After this, the remaining error is a TTY error:
```
Error: your terminal supports neither 24-bit nor 8-bit colors. Other coloring
options aren't available
```
PiperOrigin-RevId: 610931919
2024-02-27 17:57:41 -08:00
Otto BittnerandMalte Poll de23b3e85f nvproxy: add ioctls required for Nvidia H100
Co-authored-by: Malte Poll <mp@edgeless.systems>
2024-02-16 16:19:21 +01:00
Ayush RanjanandgVisor bot 1b8d53a614 Fix NV_CHANNEL_ALLOC_PARAMS for 535.86.05+ drivers.
Updates #9846.

PiperOrigin-RevId: 606758290
2024-02-13 15:04:23 -08:00
Ayush RanjanandgVisor bot 98df07c3cd Add NV50_P2P allocation class support in nvproxy.
Updates #9827.

PiperOrigin-RevId: 596766912
2024-01-08 19:22:29 -08:00
Ayush RanjanandgVisor bot fd9845ccea Fix NV_MEMORY_FABRIC for 535.43.02+ drivers.
Updates #9372

PiperOrigin-RevId: 577494512
2023-10-28 12:44:38 -07:00
Ayush RanjanandgVisor bot 584791a1f0 Add support for Nvidia driver versions after 535.43.02.
Nvproxy now supports 535.54.03 and 535.104.05 versions.
Tested on T4 GPU for these versions.
```
$ docker run --runtime=runsc --rm --gpus=all 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
```

PiperOrigin-RevId: 572312006
2023-10-10 11:18:34 -07:00
Ayush RanjanandgVisor bot 44633287ca Automated rollback of changelist 549837326
PiperOrigin-RevId: 570426281
2023-10-03 10:29:12 -07:00
Jing ChenandgVisor bot e81e0c72a7 Add NV_MEMORY_FABRIC to nvproxy.
Fixes #9372

PiperOrigin-RevId: 567816690
2023-09-23 00:47:37 -07:00
Ayush RanjanandgVisor bot 41ec0d4189 Add nvproxy support for V100 Nvidia GPUs.
Tested on 1 V100 GPU:
```
$ docker run --runtime=runsc --rm --gpus all 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
```

PiperOrigin-RevId: 549837326
2023-07-20 22:09:39 -07:00