-
Thank you very much for your answer. The problem I encountered is: I can get the PCI device number of NVIDIA graphics card, such as (81:00.0). I want to use this device number to correspond to my local device name (/dev/nvidia0). What is the connection between the PCI device number and the device name. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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() Once nvidia.ko is loaded, I think you can look at I hope that helps. |
Beta Was this translation helpful? Give feedback.
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…