Skip to content

Commit

Permalink
Merge pull request #137 from slaclab/pre-release
Browse files Browse the repository at this point in the history
Release Candidate 6.2.0
  • Loading branch information
ruck314 authored Jun 3, 2024
2 parents 2f3c2d4 + d1a0b5f commit b034be1
Show file tree
Hide file tree
Showing 5 changed files with 504 additions and 287 deletions.
8 changes: 8 additions & 0 deletions common/driver/dma_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,14 @@ ssize_t Dma_Ioctl(struct file *filp, uint32_t cmd, unsigned long arg) {
}
break;

// Get GIT Version
case DMA_Get_GITV:
if (copy_to_user((char *)arg, GITV, strnlen(GITV, 32))) {
return -EFAULT;
}
return 0;
break;

// Get API Version
case DMA_Get_Version:
return DMA_VERSION;
Expand Down
33 changes: 25 additions & 8 deletions data_gpu/driver/comp_and_load_drivers.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
#!/bin/bash

# Function to check if gcc-12 is installed
check_gcc_12_installed() {
if ! command -v gcc-12 >/dev/null 2>&1; then
echo "Error: gcc-12 is not installed. Please install gcc-12 and try again." >&2
# Provide defaults for CC
[ -z "$CC" ] && CC=gcc

# Function to check if the script is run with sudo
check_sudo() {
if [ "$EUID" -ne 0 ]; then
echo "Error: This script must be run with sudo." >&2
exit 1
fi
}
# Checks that GCC matches what the kernel was built with
check_gcc_version() {
_GCC_VER="$($CC --version | grep -Eo "\s[0-9]+\.[0-9]+\.[0-9]+\s" | awk '{$1=$1};1')"
if ! cat /proc/version | grep -Eoq "gcc version $_GCC_VER"; then
echo "Error: GCC version 'gcc version $_GCC_VER' does not match what the kernel was built with: '$(cat /proc/version | grep -Eo "gcc version [0-9]+\.[0-9]+\.[0-9]+")'"
echo " You can specify an alternative compiler by setting the 'CC' environment variable"
exit 1
fi
}

# Check if the script is run with sudo
check_sudo

# Call the gcc-12 check function early in the script to ensure it's available
check_gcc_12_installed
# Check that our GCC matches what the kernel was built with
check_gcc_version

# Function to find the latest Nvidia version directory
get_latest_nvidia_path() {
Expand Down Expand Up @@ -46,9 +61,11 @@ echo "Using Nvidia path: $NVIDIA_PATH"

cd $NVIDIA_PATH

make CC=gcc-12
make

modprobe ecc || { echo "Error: Failed to insert ecc module."; exit 1; }
if modinfo ecc >/dev/null 2>&1; then
modprobe ecc || { echo "Error: Failed to insert ecc module."; exit 1; }
fi

/usr/sbin/insmod nvidia.ko NVreg_OpenRmEnableUnsupportedGpus=1 NVreg_EnableStreamMemOPs=1 || { echo "Error: Failed to insert nvidia.ko."; exit 1; }

Expand Down
Loading

0 comments on commit b034be1

Please sign in to comment.