We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Installing Nvidia drivers doesn't work
When building the AMI, the `install-nvidia-drivers.sh` fails with base AMI `'ami-9109beee` (latest deep learning ami) and Nvidia drivers 384.125. I was able to get it to run with the `--install-libglvnd` flag. But, when I start an instance with the resulting AMI, running `nvidia-smi` reports that the drivers aren't installed. At the moment, the latest base AMI has the Nvidia drivers we need, so I've commented out installing them, but in the future we may need this.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `deployment/packer/driver.py`
Content:
```
1 """Helper functions to handle AMI creation with packer"""
2 
3 import boto3
4 import os
5 from os.path import dirname
6 import subprocess
7 import re
8 import logging
9 
10 LOGGER = logging.getLogger(__file__)
11 LOGGER.addHandler(logging.StreamHandler())
12 LOGGER.setLevel(logging.INFO)
13 
14 
15 def get_recent_batch_ami(aws_profile):
16     """Finds the most recent Deep Learning AMI"""
17     filters = [
18         {'Name': 'architecture', 'Values': ['x86_64']},
19         {'Name': 'owner-id', 'Values': ['898082745236']},
20         {'Name': 'virtualization-type', 'Values': ['hvm']},
21     ]
22     sess = boto3.Session(profile_name=aws_profile)
23     ec2 = sess.client("ec2")
24     images = filter(
25         lambda x: re.search("Deep Learning AMI Amazon Linux .*", x['Name']),
26         ec2.describe_images(Filters=filters)['Images'])
27     images.sort(key=lambda x: x["CreationDate"])
28 
29     LOGGER.info("Found AMI: %s", images[-1]["ImageId"])
30 
31     return images[-1]["ImageId"]
32 
33 
34 def get_project_root():
35     return dirname(dirname(dirname(os.path.realpath(__file__))))
36 
37 
38 def get_git_sha():
39     """Function that executes Git to determine the current SHA"""
40     git_command = ['git',
41                    'rev-parse',
42                    '--short',
43                    'HEAD']
44 
45     src_dir = os.path.abspath(get_project_root())
46 
47     return subprocess.check_output(git_command, cwd=src_dir).rstrip()
48 
49 
50 def get_git_branch():
51     """Function that executes Git to determine the current branch"""
52     git_command = ['git',
53                    'rev-parse',
54                    '--abbrev-ref',
55                    'HEAD']
56 
57     return subprocess.check_output(git_command).rstrip()
58 
59 
60 def run_packer(aws_profile, source_ami=None, aws_region="us-east-1"):
61     """Function to run packer
62 
63     Args:
64       aws_profile (str): aws profile name to use for authentication
65       source_ami (str): AMI to use for Packer Builder
66       aws_region (str): AWS region to user for Packer Builder
67     """
68 
69     # Get AWS credentials based on profile
70     env = os.environ.copy()
71     env["AWS_PROFILE"] = aws_profile
72 
73     packer_template_path = os.path.join(get_project_root(),
74                                         'deployment', 'packer', 'template.js')
75 
76     LOGGER.info('Creating GPU Workload AMI in %s region', aws_region)
77 
78     packer_command = [
79         'packer', 'build',
80         '-var', 'raster_vision_gpu_version={}'.format(get_git_sha()),
81         '-var', 'aws_region={}'.format(aws_region),
82         '-var', 'aws_gpu_ami={}'.format(source_ami or
83                                         get_recent_batch_ami(aws_profile)),
84         '-var', 'branch={}'.format(get_git_branch())]
85 
86     packer_command.append(packer_template_path)
87 
88     LOGGER.info('Running Packer Command: %s', ' '.join(packer_command))
89     subprocess.check_call(packer_command, env=env)
90
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/deployment/packer/driver.py b/deployment/packer/driver.py
--- a/deployment/packer/driver.py
+++ b/deployment/packer/driver.py
@@ -22,7 +22,7 @@
     sess = boto3.Session(profile_name=aws_profile)
     ec2 = sess.client("ec2")
     images = filter(
-        lambda x: re.search("Deep Learning AMI Amazon Linux .*", x['Name']),
+        lambda x: re.search("Deep Learning Base AMI \(Amazon Linux\) (.*)", x['Name']),
         ec2.describe_images(Filters=filters)['Images'])
     images.sort(key=lambda x: x["CreationDate"])

{"golden_diff": "diff --git a/deployment/packer/driver.py b/deployment/packer/driver.py\n--- a/deployment/packer/driver.py\n+++ b/deployment/packer/driver.py\n@@ -22,7 +22,7 @@\n     sess = boto3.Session(profile_name=aws_profile)\n     ec2 = sess.client(\"ec2\")\n     images = filter(\n-        lambda x: re.search(\"Deep Learning AMI Amazon Linux .*\", x['Name']),\n+        lambda x: re.search(\"Deep Learning Base AMI \\(Amazon Linux\\) (.*)\", x['Name']),\n         ec2.describe_images(Filters=filters)['Images'])\n     images.sort(key=lambda x: x[\"CreationDate\"])\n", "issue": "Installing Nvidia drivers doesn't work\nWhen building the AMI, the `install-nvidia-drivers.sh` fails with base AMI `'ami-9109beee` (latest deep learning ami) and Nvidia drivers 384.125. I was able to get it to run with the `--install-libglvnd` flag. But, when I start an instance with the resulting AMI, running `nvidia-smi` reports that the drivers aren't installed. At the moment, the latest base AMI has the Nvidia drivers we need, so I've commented out installing them, but in the future we may need this.\n", "before_files": [{"content": "\"\"\"Helper functions to handle AMI creation with packer\"\"\"\n\nimport boto3\nimport os\nfrom os.path import dirname\nimport subprocess\nimport re\nimport logging\n\nLOGGER = logging.getLogger(__file__)\nLOGGER.addHandler(logging.StreamHandler())\nLOGGER.setLevel(logging.INFO)\n\n\ndef get_recent_batch_ami(aws_profile):\n    \"\"\"Finds the most recent Deep Learning AMI\"\"\"\n    filters = [\n        {'Name': 'architecture', 'Values': ['x86_64']},\n        {'Name': 'owner-id', 'Values': ['898082745236']},\n        {'Name': 'virtualization-type', 'Values': ['hvm']},\n    ]\n    sess = boto3.Session(profile_name=aws_profile)\n    ec2 = sess.client(\"ec2\")\n    images = filter(\n        lambda x: re.search(\"Deep Learning AMI Amazon Linux .*\", x['Name']),\n        ec2.describe_images(Filters=filters)['Images'])\n    images.sort(key=lambda x: x[\"CreationDate\"])\n\n    LOGGER.info(\"Found AMI: %s\", images[-1][\"ImageId\"])\n\n    return images[-1][\"ImageId\"]\n\n\ndef get_project_root():\n    return dirname(dirname(dirname(os.path.realpath(__file__))))\n\n\ndef get_git_sha():\n    \"\"\"Function that executes Git to determine the current SHA\"\"\"\n    git_command = ['git',\n                   'rev-parse',\n                   '--short',\n                   'HEAD']\n\n    src_dir = os.path.abspath(get_project_root())\n\n    return subprocess.check_output(git_command, cwd=src_dir).rstrip()\n\n\ndef get_git_branch():\n    \"\"\"Function that executes Git to determine the current branch\"\"\"\n    git_command = ['git',\n                   'rev-parse',\n                   '--abbrev-ref',\n                   'HEAD']\n\n    return subprocess.check_output(git_command).rstrip()\n\n\ndef run_packer(aws_profile, source_ami=None, aws_region=\"us-east-1\"):\n    \"\"\"Function to run packer\n\n    Args:\n      aws_profile (str): aws profile name to use for authentication\n      source_ami (str): AMI to use for Packer Builder\n      aws_region (str): AWS region to user for Packer Builder\n    \"\"\"\n\n    # Get AWS credentials based on profile\n    env = os.environ.copy()\n    env[\"AWS_PROFILE\"] = aws_profile\n\n    packer_template_path = os.path.join(get_project_root(),\n                                        'deployment', 'packer', 'template.js')\n\n    LOGGER.info('Creating GPU Workload AMI in %s region', aws_region)\n\n    packer_command = [\n        'packer', 'build',\n        '-var', 'raster_vision_gpu_version={}'.format(get_git_sha()),\n        '-var', 'aws_region={}'.format(aws_region),\n        '-var', 'aws_gpu_ami={}'.format(source_ami or\n                                        get_recent_batch_ami(aws_profile)),\n        '-var', 'branch={}'.format(get_git_branch())]\n\n    packer_command.append(packer_template_path)\n\n    LOGGER.info('Running Packer Command: %s', ' '.join(packer_command))\n    subprocess.check_call(packer_command, env=env)\n", "path": "deployment/packer/driver.py"}], "after_files": [{"content": "\"\"\"Helper functions to handle AMI creation with packer\"\"\"\n\nimport boto3\nimport os\nfrom os.path import dirname\nimport subprocess\nimport re\nimport logging\n\nLOGGER = logging.getLogger(__file__)\nLOGGER.addHandler(logging.StreamHandler())\nLOGGER.setLevel(logging.INFO)\n\n\ndef get_recent_batch_ami(aws_profile):\n    \"\"\"Finds the most recent Deep Learning AMI\"\"\"\n    filters = [\n        {'Name': 'architecture', 'Values': ['x86_64']},\n        {'Name': 'owner-id', 'Values': ['898082745236']},\n        {'Name': 'virtualization-type', 'Values': ['hvm']},\n    ]\n    sess = boto3.Session(profile_name=aws_profile)\n    ec2 = sess.client(\"ec2\")\n    images = filter(\n        lambda x: re.search(\"Deep Learning Base AMI \\(Amazon Linux\\) (.*)\", x['Name']),\n        ec2.describe_images(Filters=filters)['Images'])\n    images.sort(key=lambda x: x[\"CreationDate\"])\n\n    LOGGER.info(\"Found AMI: %s\", images[-1][\"ImageId\"])\n\n    return images[-1][\"ImageId\"]\n\n\ndef get_project_root():\n    return dirname(dirname(dirname(os.path.realpath(__file__))))\n\n\ndef get_git_sha():\n    \"\"\"Function that executes Git to determine the current SHA\"\"\"\n    git_command = ['git',\n                   'rev-parse',\n                   '--short',\n                   'HEAD']\n\n    src_dir = os.path.abspath(get_project_root())\n\n    return subprocess.check_output(git_command, cwd=src_dir).rstrip()\n\n\ndef get_git_branch():\n    \"\"\"Function that executes Git to determine the current branch\"\"\"\n    git_command = ['git',\n                   'rev-parse',\n                   '--abbrev-ref',\n                   'HEAD']\n\n    return subprocess.check_output(git_command).rstrip()\n\n\ndef run_packer(aws_profile, source_ami=None, aws_region=\"us-east-1\"):\n    \"\"\"Function to run packer\n\n    Args:\n      aws_profile (str): aws profile name to use for authentication\n      source_ami (str): AMI to use for Packer Builder\n      aws_region (str): AWS region to user for Packer Builder\n    \"\"\"\n\n    # Get AWS credentials based on profile\n    env = os.environ.copy()\n    env[\"AWS_PROFILE\"] = aws_profile\n\n    packer_template_path = os.path.join(get_project_root(),\n                                        'deployment', 'packer', 'template.js')\n\n    LOGGER.info('Creating GPU Workload AMI in %s region', aws_region)\n\n    packer_command = [\n        'packer', 'build',\n        '-var', 'raster_vision_gpu_version={}'.format(get_git_sha()),\n        '-var', 'aws_region={}'.format(aws_region),\n        '-var', 'aws_gpu_ami={}'.format(source_ami or\n                                        get_recent_batch_ami(aws_profile)),\n        '-var', 'branch={}'.format(get_git_branch())]\n\n    packer_command.append(packer_template_path)\n\n    LOGGER.info('Running Packer Command: %s', ' '.join(packer_command))\n    subprocess.check_call(packer_command, env=env)\n", "path": "deployment/packer/driver.py"}]}