Skip to content

Commit

Permalink
fix: Check for GPU driver name, not just vendor (#115)
Browse files Browse the repository at this point in the history
Changes GPU checks in `setup.sh` and `davinci.sh` to check for the
driver name in use, rather than GPU vendor.

Fixes #113
  • Loading branch information
zelikos authored Aug 15, 2024
1 parent cd48614 commit 3e51fa3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set_container_type () {

get_gpu_type () {
if command -v lshw &> /dev/null; then
if lshw -c video 2>/dev/null | grep -qi nvidia; then
if lshw -c video 2>/dev/null | grep -qi "driver=nvidia"; then
echo "Nvidia GPU detected."
nvidia_gpu=true
fi
Expand Down
13 changes: 9 additions & 4 deletions system_files/etc/profile.d/davinci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ export QT_QPA_PLATFORM=xcb
gpu_type=""

get_gpu_type () {
if lshw -c video 2>/dev/null | grep -qi nvidia; then
# Checks only for nvidia driver and not nouveau
if lshw -c video 2>/dev/null | grep -qi "driver=nvidia"; then
gpu_type="nvidia"
elif lshw -c video 2>/dev/null | grep -qi amd; then
# Checks for amdgpu so that we can specify using rusticl by default
elif lshw -c video 2>/dev/null | grep -qi "driver=amdgpu"; then
gpu_type="amd"
elif lshw -c video 2>/dev/null | grep -qi intel; then
gpu_type="intel"
# We don't have any special handling necessary for Intel GPUs at this time,
# so we aren't currently checking for them.
# In case we need to in the future, the Intel drivers are:
# - driver=i915
# - driver=xe
fi
}

Expand Down

0 comments on commit 3e51fa3

Please sign in to comment.