|
58 | 58 |
|
59 | 59 | # install nvidia drivers |
60 | 60 | pushd /opt/gpu |
61 | | -/opt/gpu/${RUNFILE}/nvidia-installer -s -k=$KERNEL_NAME --log-file-name=${LOG_FILE_NAME} -a --no-drm --dkms --utility-prefix="${GPU_DEST}" --opengl-prefix="${GPU_DEST}" |
| 61 | +/opt/gpu/${RUNFILE}/nvidia-installer -s -k=$KERNEL_NAME --log-file-name=${LOG_FILE_NAME} -a --no-drm --dkms |
62 | 62 | popd |
63 | 63 |
|
64 | 64 | # move nvidia libs to correct location from temporary overlayfs |
65 | 65 | cp -a /tmp/overlay/lib64 ${GPU_DEST}/lib64 |
66 | 66 |
|
67 | | -handle_nvidia_systemd_units() { |
68 | | - SYSTEMD_SRC="/usr/lib/nvidia/systemd" |
69 | | - SYSTEMD_DEST="/etc/systemd/system" |
70 | | - moved_units=() |
71 | | - |
72 | | - # Check if the source directory exists |
73 | | - if [[ -d "$SYSTEMD_SRC" ]]; then |
74 | | - # Use find to list *.service files in the source directory |
75 | | - found_files=$(find "$SYSTEMD_SRC" -maxdepth 1 -name "*.service") |
76 | | - if [ -z "$found_files" ]; then |
77 | | - echo "No systemd unit files found in $SYSTEMD_SRC" |
78 | | - else |
79 | | - # Loop through each found file, move it, and record its name |
80 | | - while IFS= read -r unit; do |
81 | | - mv "$unit" "$SYSTEMD_DEST/" |
82 | | - unit_name=$(basename "$unit") |
83 | | - moved_units+=("$unit_name") |
84 | | - echo "Moved $unit_name to $SYSTEMD_DEST" |
85 | | - done <<< "$found_files" |
86 | | - fi |
87 | | - else |
88 | | - echo "Source directory $SYSTEMD_SRC does not exist. Skipping systemd unit file move." |
89 | | - fi |
90 | | - |
91 | | - # Reload systemd to pick up the moved unit files |
92 | | - systemctl daemon-reload |
93 | | - |
94 | | - # Enable and restart only the moved units |
95 | | - for unit_name in "${moved_units[@]}"; do |
96 | | - systemctl enable "$unit_name" |
97 | | - systemctl restart "$unit_name" |
98 | | - echo "$unit_name enabled and restarted." |
99 | | - done |
100 | | -} |
101 | | - |
102 | | -# grid starts a daemon that prevents copying binaries |
103 | | -if [ "${DRIVER_KIND}" == "grid" ]; then |
104 | | - systemctl stop nvidia-gridd || true |
105 | | -fi |
106 | | - |
107 | | -# move nvidia binaries to /usr/bin...because we like that? |
108 | | -cp -rvT ${GPU_DEST}/bin /usr/bin || true |
109 | | - |
110 | | -# restart that daemon, lol |
111 | | -if [ "${DRIVER_KIND}" == "grid" ]; then |
112 | | - systemctl restart nvidia-gridd || true |
113 | | -fi |
114 | | - |
115 | | -handle_nvidia_systemd_units |
116 | | - |
117 | 67 | # configure system to know about nvidia lib paths |
118 | 68 | echo "${GPU_DEST}/lib64" > /etc/ld.so.conf.d/nvidia.conf |
119 | 69 | ldconfig |
|
0 commit comments