Skip to content

Commit

Permalink
[vgpu-manager] update firmware search path so nvidia kernel module ca…
Browse files Browse the repository at this point in the history
…n find GSP firmware

Signed-off-by: Christopher Desiniotis <[email protected]>
  • Loading branch information
cdesiniotis committed Apr 11, 2024
1 parent dd69782 commit fec31da
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
17 changes: 16 additions & 1 deletion vgpu-manager/rhel8/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ _create_dev_char_directory() {
fi
}

_set_fw_search_path() {
local nv_fw_search_path="$RUN_DIR/driver/lib/firmware"
local set_fw_path="true"
local fw_path_config_file="/sys/module/firmware_class/parameters/path"

if [[ ! -z $(grep '[^[:space:]]' $fw_path_config_file) ]]; then
echo "WARNING: A search path is already configured in $fw_path_config_file"
echo " Retaining the current configuration. Note, GSP firmware may not be found and thus won't be used by the NVIDIA driver."
return
fi

echo "Configuring the following firmware search path in '$fw_path_config_file': $nv_fw_search_path"
echo -n "$nv_fw_search_path" > $fw_path_config_file
}

_install_driver() {
local tmp_dir=$(mktemp -d)

Expand Down Expand Up @@ -159,8 +174,8 @@ init() {
exit 1
fi
_unmount_rootfs

_create_dev_char_directory
_set_fw_search_path
_install_driver
_load_driver || exit 1
_mount_rootfs
Expand Down
16 changes: 16 additions & 0 deletions vgpu-manager/ubuntu20.04/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,21 @@ _create_dev_char_directory() {
fi
}

_set_fw_search_path() {
local nv_fw_search_path="$RUN_DIR/driver/lib/firmware"
local set_fw_path="true"
local fw_path_config_file="/sys/module/firmware_class/parameters/path"

if [[ ! -z $(grep '[^[:space:]]' $fw_path_config_file) ]]; then
echo "WARNING: A search path is already configured in $fw_path_config_file"
echo " Retaining the current configuration. Note, GSP firmware may not be found and thus won't be used by the NVIDIA driver."
return
fi

echo "Configuring the following firmware search path in '$fw_path_config_file': $nv_fw_search_path"
echo -n "$nv_fw_search_path" > $fw_path_config_file
}

_install_driver() {
local tmp_dir=$(mktemp -d)

Expand Down Expand Up @@ -238,6 +253,7 @@ init() {
_resolve_kernel_version || exit 1
_install_prerequisites
_create_dev_char_directory
_set_fw_search_path
_install_driver
_load_driver || exit 1
_mount_rootfs
Expand Down
16 changes: 16 additions & 0 deletions vgpu-manager/ubuntu22.04/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ _create_dev_char_directory() {
fi
}

_set_fw_search_path() {
local nv_fw_search_path="$RUN_DIR/driver/lib/firmware"
local set_fw_path="true"
local fw_path_config_file="/sys/module/firmware_class/parameters/path"

if [[ ! -z $(grep '[^[:space:]]' $fw_path_config_file) ]]; then
echo "WARNING: A search path is already configured in $fw_path_config_file"
echo " Retaining the current configuration. Note, GSP firmware may not be found and thus won't be used by the NVIDIA driver."
return
fi

echo "Configuring the following firmware search path in '$fw_path_config_file': $nv_fw_search_path"
echo -n "$nv_fw_search_path" > $fw_path_config_file
}

# Currently _install_driver() takes care of loading nvidia modules. Just need to start necessary vgpu daemons
_load_driver() {
/usr/bin/nvidia-vgpud &
Expand Down Expand Up @@ -238,6 +253,7 @@ init() {
_resolve_kernel_version || exit 1
_install_prerequisites
_create_dev_char_directory
_set_fw_search_path
_install_driver
_load_driver || exit 1
_mount_rootfs
Expand Down

0 comments on commit fec31da

Please sign in to comment.