microsoft / microsoft/WSL

Allow user to specify CPU VA for device allocation via dxgkio_lock2()

Open
#11,077 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature GPU
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

**Is your feature request related to a problem? Please describe.**
NO

**Describe the solution you'd like**
The motivation is that we want to use unified VA for GPU and CPU for a device allocation.

Use case:
1, Create a device allocation with dxgkio_create_allocation()
2, Map the allocation and get a GPU VA with dxgkio_map_gpu_va()
3, Get a CPU VA of the allocation with dxgkio_lock2()

The problem is GPU VA != CPU VA with dxgkio_lock2() implementation.

struct d3dkmt_lock2 {
struct d3dkmthandle device;
struct d3dkmthandle allocation;
struct d3dddicb_lock2flags flags;
__u32 reserved;
#ifdef __KERNEL__
void *data;
#else
__u64 data;
#endif
};

The solution is allowing user to specify VA through data filed.
It would be better to specify mapping flags(read/write/execute) through flags filed.

**Describe alternatives you've considered**

**Additional context**
https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__UNIFIED.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the dxgkio_lock2() path and comparing it with dxgkio_create_allocation() and dxgkio_map_gpu_va(). Review the d3dkmt_lock2 structure and the linked CUDA unified-addressing documentation. Done means the allocation can use a user-specified CPU VA matching the GPU VA, with the requested mapping permissions represented by the flags.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.