Skip to content

Instantly share code, notes, and snippets.

@fwyzard
fwyzard / install CUDA.md
Last active October 16, 2019 15:34
Install CUDA and repacke the NVIDIA kernel modules

RHEL 7

download the CUDA RPMs:

ssh -f -N -o ControlMaster=auto -D 1080 cmsusr.cms 
export ALL_PROXY=socks5://localhost:1080
curl http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-rhel7-10-1-local-10.1.243-418.87.00-1.0-1.x86_64.rpm -o cuda-repo-rhel7-10-1-local-10.1.243-418.87.00-1.0-1.x86_64.rpm

unpack the individual RPMs under /var/cuda-repo-10-1-local-10.1.243-418.87.00/:

@fwyzard
fwyzard / build.sh
Last active February 25, 2020 16:42
Build the Intel or Codeplay LLVM branches
#! /bin/bash -e
CUDA_BASE=/usr/local/cuda
SYCL_BASE=$PWD
INSTALL_PATH=/opt/llvm
mkdir -p $SYCL_BASE/llvm
cd $SYCL_BASE/llvm
if ! [ -d .git ]; then
@fwyzard
fwyzard / test.cu
Last active November 23, 2021 14:04
Test program to check what CUDA operations can be performed on a device different than the current one
#include <cuda_runtime.h>
#include "cudaCheck.h"
int main(void) {
// 3D buffer layout
constexpr size_t pitch = 32;
constexpr size_t width = 20;
static_assert(width <= pitch, "The 3D buffer `width` cannot be larger than the `pitch`.");
constexpr size_t height = 8;
constexpr size_t slices = 4;