Skip to content

Commit

Permalink
Use wget to download NVidia driver (#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
themylogin authored Jan 23, 2025
1 parent 1736d42 commit 4d4b5a0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions scale_build/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class NvidiaExtension(Extension):
binaries = ("apt", "apt-config", "apt-key", "dpkg")
temporary_packages = ["gcc", "make", "pkg-config"]
permanent_packages = ["libvulkan1", "nvidia-container-toolkit", "vulkan-validationlayers"]
headers = {"User-Agent": "curl/7.88.1"}

def build_impl(self):
kernel_version = get_kernel_version(self.chroot)
Expand Down Expand Up @@ -158,10 +157,7 @@ def download_nvidia_driver(self):
filename = f"NVIDIA-Linux-x86_64-{version}-no-compat32.run"
result = f"{self.chroot}/{filename}"

with requests.get(f"{prefix}/{version}/{filename}", headers=self.headers, stream=True, timeout=10) as r:
r.raise_for_status()
with open(result, "wb") as f:
shutil.copyfileobj(r.raw, f)
self.run(["wget", "-c", "-O", f"/{filename}", f"{prefix}/{version}/{filename}"])

os.chmod(result, 0o755)
return result
Expand Down

0 comments on commit 4d4b5a0

Please sign in to comment.