Correct creation of BusID

Correct creation of BusID

There is a problem with forming of the correct sequence of BusID PCI
Problem with BusID PCI as I can’t find the correct command to build them one after another.
I tried through this command:
sudo nvidia-xconfig -a–preserve-busid
But not always correctly works:

Section “Device”
Identifier “Device0”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1080 Ti”
BusID “PCI:5:0:0”
EndSection

Section “Device”
Identifier “Device1”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1080 Ti”
BusID “PCI:4:0:0”
EndSection

Section “Device”
Identifier “Device2”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1080 Ti”
BusID “PCI:3:0:0”
EndSection

But it is necessary for me that it was stable:

Section “Device”
Identifier “Device0”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1080 Ti”
BusID “PCI:3:0:0”
EndSection

Section “Device”
Identifier “Device1”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1080 Ti”
BusID “PCI:4:0:0”
EndSection

Section “Device”
Identifier “Device2”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1080 Ti”
BusID “PCI:5:0:0”
EndSection

Any ideas?

The question is, why doesn’t it work when you don’t order the config by pci bus id?
Does using the persistence daemon work around this?

I use several Graphic Card on my PC, and use script for auto-control cooler on GC, example:

#!/bin/bash

export DISPLAY=:0

NUM_CARDS=3
NS=“/usr/bin/nvidia-settings”

while true
do
for ((i=0; i<$NUM_CARDS;i++))
{
GPU_TEMP=nvidia-smi -i $i --query-gpu=temperature.gpu --format=csv,noheader
FAN_SPEED=nvidia-smi -i $i --query-gpu=fan.speed --format=csv,noheader,nounits
if (($GPU_TEMP < 65)); then
(($GPU_TEMP!=$FAN_SPEED)) && $NS -a [gpu:$i]/GPUFanControlState=1 -a [fan-$i]/GPUTargetFanSpeed=$GPU_TEMP > /dev/null 2>&1
else
if (($GPU_TEMP < 70)); then
let “TARGET_FAN_SPEED=GPU_TEMP+10”
(($TARGET_FAN_SPEED != $FAN_SPEED)) && $NS -a [gpu:$i]/GPUFanControlState=1 -a [fan-$i]/GPUTargetFanSpeed=$TARGET_FAN_SPEED > /dev/null 2>&1
else
let “TARGET_FAN_SPEED = GPU_TEMP + 20”
(($TARGET_FAN_SPEED != $FAN_SPEED)) && $NS -a [gpu:$i]/GPUFanControlState=1 -a [fan-$i]/GPUTargetFanSpeed=$TARGET_FAN_SPEED > /dev/null 2>&1
fi
fi
}

sleep 10
done

Some times I changed GC in my PC and every time I must to edit settings manual, if I don’t make it, I’ll have hot one or two GC and coolers are exposed on a minimum, other GC have normal temperature but a cooler work at a maximum.
Thanks.