Skip to content

who creates /dev/nvidia0 #336

Answered by aritger
lremember asked this question in Q&A
Jul 27, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

To answer the question in your subject line, it is the program nvidia-modprobe that creates the /dev/nvidiaN device files. This is a little backwards, but IIRC the in-kernel interface to creating device files isn't available to the non-GPL nvidia.ko, and the open nvidia.ko inherited that behavior.

For how to map between PCI bus ID and /dev/nvidiaN number, the GPU enumeration code in the driver is probably a bit more complicated than necessary. Relevant functions include:

nv-pci.c:nv_pci_probe()
nv.c:nv_linux_add_device_locked()
nv.c:nvidia_read_card_info()

Once nvidia.ko is loaded, I think you can look at /proc/driver/nvidia/gpus/${busid}/information. The "Device Minor" number in that fil…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lremember
Comment options

Answer selected by mtijanic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants