forked from pool/nvidia-open-driver-G06-signed
- Add a second flavor for building the kernel module versions used by CUDA. The kmp targetting CUDA contains '-cuda' in its name to track its versions separately from the graphics kmp. - Provide the meta package nv-prefer-signed-open-driver to make sure the latest available SUSE-build open driver is installed - independent of the latest available open driver version in he CUDA repository. Rationale: The package cuda-runtime provides the link between CUDA and the kernel driver version through a Requires: cuda-drivers >= %version This implies that a CUDA version will run withany kernel driver version equal or higher than a base version. nvidia-compute-G06 provides the glue layer between CUDA and a specific version of he kernel driver both by providing a set of base libraries and by requiring a specific kernel version. 'cuda-drivers' (provided by nvidia-compute-utils-G06) requires an unversioned nvidia-compute-G06. With this, the resolver will install the latest available and applicable nvidia-compute-G06. nv-prefer-signed-open-driver then represents the latest available open driver version and restricts the nvidia-compute-G06 version to it. * addresses boo#1223454 OBS-URL: https://build.opensuse.org/request/show/1185229 OBS-URL: https://build.opensuse.org/package/show/X11:Drivers:Video:Redesign/nvidia-open-driver-G06-signed?expand=0&rev=101
43 lines
1.7 KiB
Plaintext
43 lines
1.7 KiB
Plaintext
# convert to one line via " awk '{ printf "%s ", $0 }' " script.txt'
|
|
|
|
PATH=$PATH:/bin:/usr/bin;
|
|
if /sbin/modprobe --ignore-install nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=$(getent group video | cut -d: -f3) NVreg_DeviceFileMode=0660 NVreg_PreserveVideoMemoryAllocations=1; then
|
|
if /sbin/modprobe nvidia_uvm; then
|
|
if [ ! -c /dev/nvidia-uvm ]; then
|
|
mknod -m 660 /dev/nvidia-uvm c $(cat /proc/devices | while read major device; do if [ "$device" == "nvidia-uvm" ]; then echo $major; break; fi ; done) 0;
|
|
chown :video /dev/nvidia-uvm;
|
|
fi;
|
|
if [ ! -c /dev/nvidia-uvm-tools ]; then
|
|
mknod -m 660 /dev/nvidia-uvm-tools c $(cat /proc/devices | while read major device; do if [ "$device" == "nvidia-uvm" ]; then echo $major; break; fi ; done) 1;
|
|
chown :video /dev/nvidia-uvm-tools;
|
|
fi;
|
|
fi;
|
|
if [ ! -c /dev/nvidiactl ]; then
|
|
mknod -m 660 /dev/nvidiactl c 195 255;
|
|
chown :video /dev/nvidiactl;
|
|
fi;
|
|
devid=-1;
|
|
for dev in $(ls -d /sys/bus/pci/devices/*); do
|
|
vendorid=$(cat $dev/vendor);
|
|
if [ "$vendorid" == "0x10de" ]; then
|
|
class=$(cat $dev/class);
|
|
classid=${class%%00};
|
|
if [ "$classid" == "0x0300" -o "$classid" == "0x0302" ]; then
|
|
devid=$((devid+1));
|
|
if [ ! -L /run/udev/static_node-tags/uaccess/nvidia${devid} ]; then
|
|
ln -snf /dev/nvidia${devid} /run/udev/static_node-tags/uaccess/nvidia${devid};
|
|
fi;
|
|
if [ ! -c /dev/nvidia${devid} ]; then
|
|
mknod -m 660 /dev/nvidia${devid} c 195 ${devid};
|
|
chown :video /dev/nvidia${devid};
|
|
fi;
|
|
fi;
|
|
fi;
|
|
done;
|
|
/sbin/modprobe nvidia_drm;
|
|
if [ ! -c /dev/nvidia-modeset ]; then
|
|
mknod -m 660 /dev/nvidia-modeset c 195 254;
|
|
chown :video /dev/nvidia-modeset;
|
|
fi;
|
|
fi
|