Skip to content

Commit

Permalink
Merge pull request #21 from cdesiniotis/vgpu-manager-fw-search-path
Browse files Browse the repository at this point in the history
[vgpu-manager] update firmware search path
  • Loading branch information
cdesiniotis authored Jun 7, 2024
2 parents 81a52fc + 8057298 commit 497684d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
16 changes: 15 additions & 1 deletion vgpu-manager/rhel8/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ _create_dev_char_directory() {
fi
}

_set_fw_search_path() {
local nv_fw_search_path="$RUN_DIR/driver/lib/firmware"
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 @@ -165,8 +179,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
15 changes: 15 additions & 0 deletions vgpu-manager/ubuntu20.04/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ _create_dev_char_directory() {
fi
}

_set_fw_search_path() {
local nv_fw_search_path="$RUN_DIR/driver/lib/firmware"
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 @@ -244,6 +258,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
15 changes: 15 additions & 0 deletions vgpu-manager/ubuntu22.04/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ _create_dev_char_directory() {
fi
}

_set_fw_search_path() {
local nv_fw_search_path="$RUN_DIR/driver/lib/firmware"
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 @@ -244,6 +258,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 497684d

Please sign in to comment.