Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated manylinux build images #470

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build-harvester-linux-x86-64:
runs-on: ubuntu-20.04
container:
image: ghcr.io/chia-network/build-images/manylinux2014_cuda_x86_64:sha-1caf046d5ff19b7c743de2a106dd86928794032b
image: ghcr.io/chia-network/build-images/manylinux_cuda_x86_64:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
build-harvester-linux-arm64:
runs-on: [ARM64, Linux]
container:
image: ghcr.io/chia-network/build-images/manylinux2014_cuda_aarch64:sha-1caf046d5ff19b7c743de2a106dd86928794032b
image: ghcr.io/chia-network/build-images/manylinux_cuda_aarch64:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
if-no-files-found: error

build-harvester-macos-x86-64:
runs-on: macOS-11
runs-on: macOS-12
steps:
- name: Cleanup Environment
uses: Chia-Network/actions/clean-workspace@main
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
build-bladebit-centos-x86-64:
runs-on: ubuntu-20.04
container:
image: quay.io/centos/centos:stream8
image: chianetwork/rocky8-builder:latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -339,7 +339,7 @@ jobs:
build-bladebit-centos-arm64:
runs-on: [ARM64, Linux]
container:
image: quay.io/centos/centos:stream8
image: chianetwork/rocky8-builder:latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
6 changes: 5 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@
// "--memo", "80a836a74b077cabaca7a76d1c3c9f269f7f3a8f2fa196a65ee8953eb81274eb8b7328d474982617af5a0fe71b47e9b8ade0cc43610ce7540ab96a524d0ab17f5df7866ef13d1221a7203e5d10ad2a4ae37f7b73f6cdfd6ddf4122e8a1c2f8ef207d52406afa2b6d7d92ea778f407205bd9dca40816c1b1cacfca2a6612b93eb",

"args":
"-w -n 1 -z 1 -f ade0cc43610ce7540ab96a524d0ab17f5df7866ef13d1221a7203e5d10ad2a4ae37f7b73f6cdfd6ddf4122e8a1c2f8ef -p 80a836a74b077cabaca7a76d1c3c9f269f7f3a8f2fa196a65ee8953eb81274eb8b7328d474982617af5a0fe71b47e9b8 -i c6b84729c23dc6d60c92f22c17083f47845c1179227c5509f07a5d2804a7b835 cudaplot --check 100 --check-threshold 2 /home/harold/plot",

// List devices
"-w -n 1 -z 1 -f ade0cc43610ce7540ab96a524d0ab17f5df7866ef13d1221a7203e5d10ad2a4ae37f7b73f6cdfd6ddf4122e8a1c2f8ef -p 80a836a74b077cabaca7a76d1c3c9f269f7f3a8f2fa196a65ee8953eb81274eb8b7328d474982617af5a0fe71b47e9b8 cudaplot -l",

// "-w -n 1 -z 1 -f ade0cc43610ce7540ab96a524d0ab17f5df7866ef13d1221a7203e5d10ad2a4ae37f7b73f6cdfd6ddf4122e8a1c2f8ef -p 80a836a74b077cabaca7a76d1c3c9f269f7f3a8f2fa196a65ee8953eb81274eb8b7328d474982617af5a0fe71b47e9b8 -i c6b84729c23dc6d60c92f22c17083f47845c1179227c5509f07a5d2804a7b835 cudaplot --check 100 --check-threshold 2 /home/harold/plot",

// "-w -z 1 -f ade0cc43610ce7540ab96a524d0ab17f5df7866ef13d1221a7203e5d10ad2a4ae37f7b73f6cdfd6ddf4122e8a1c2f8ef -p 80a836a74b077cabaca7a76d1c3c9f269f7f3a8f2fa196a65ee8953eb81274eb8b7328d474982617af5a0fe71b47e9b8 -i c6b84729c23dc6d60c92f22c17083f47845c1179227c5509f07a5d2804a7b835 cudaplot /home/harold/plot",
// "-w -z 1 -f ade0cc43610ce7540ab96a524d0ab17f5df7866ef13d1221a7203e5d10ad2a4ae37f7b73f6cdfd6ddf4122e8a1c2f8ef -p 80a836a74b077cabaca7a76d1c3c9f269f7f3a8f2fa196a65ee8953eb81274eb8b7328d474982617af5a0fe71b47e9b8 -i c6b84729c23dc6d60c92f22c17083f47845c1179227c5509f07a5d2804a7b835 cudaplot --disk-128 -t1 /home/harold/plotdisk --no-direct-buffers /home/harold/plot",
Expand Down
73 changes: 73 additions & 0 deletions cuda/CudaPlotter.cu
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static void UploadBucketToGpu( CudaK32PlotContext& context, TableId table, const
static void LoadAndSortBucket( CudaK32PlotContext& cx, const uint32 bucket );

void CudaMatchBucketizedK32( CudaK32PlotContext& cx, const uint32* devY, cudaStream_t stream, cudaEvent_t event );
[[noreturn]] static void ListCudaDevices( bool json );

// Defined in FxCuda.cu
void GenFx( CudaK32PlotContext& cx, const uint32* devYIn, const uint32* devMetaIn, cudaStream_t stream );
Expand All @@ -59,6 +60,11 @@ GPU-based (CUDA) plotter
-h, --help : Shows this help message and exits.
-d, --device : Select the CUDA device index. (default=0)

-l, --list : List availabe CUDA devices, showing their indices.

--json : Show output in json format. This is only valid for certain parameters:
--list

--disk-128 : Enable hybrid disk plotting for 128G system RAM.
Requires a --temp1 and --temp2 to be set.

Expand Down Expand Up @@ -95,6 +101,9 @@ void CudaK32Plotter::ParseCLI( const GlobalPlotConfig& gCfg, CliParser& cli )
CudaK32PlotConfig& cfg = _cfg;
cfg.gCfg = &gCfg;

bool listDevices = false;
bool json = false;

while( cli.HasArgs() )
{
if( cli.ReadU32( cfg.deviceIndex, "-d", "--device" ) )
Expand Down Expand Up @@ -127,6 +136,10 @@ void CudaK32Plotter::ParseCLI( const GlobalPlotConfig& gCfg, CliParser& cli )
continue;
if( cli.ReadF64( cfg.plotCheckThreshhold, "--check-threshold" ) )
continue;
if( cli.ReadSwitch( json, "--json" ) )
continue;
if( cli.ReadSwitch( listDevices, "-l", "--list" ) )
continue;
// if( cli.ReadSwitch( cfg.disableDirectDownloads, "--no-direct-buffers" ) )
// continue;
if( cli.ArgMatch( "--help", "-h" ) )
Expand All @@ -139,6 +152,8 @@ void CudaK32Plotter::ParseCLI( const GlobalPlotConfig& gCfg, CliParser& cli )
}
// The rest should be output directies, parsed by the global config parser.

if( listDevices )
ListCudaDevices( json );

if( cfg.hybrid128Mode && gCfg.compressionLevel <= 0 )
{
Expand Down Expand Up @@ -347,6 +362,64 @@ void CudaInit( CudaK32PlotContext& cx )
//FatalIf( supportsCoopLaunch != 1, "This CUDA device does not support cooperative kernel launches." );
}

//-----------------------------------------------------------
void ListCudaDevices( const bool json )
{
cudaError_t err = cudaSuccess;
int deviceCount = 0;

#define CheckCudaSuccess( x ) if( (err = x) != cudaSuccess ) goto CUDA_ERROR_EXIT;

{
CheckCudaSuccess( cudaGetDeviceCount( &deviceCount ) );

if( deviceCount < 1 )
{
const char* e = "No CUDA devices available.";
if( json )
Log::Line( R"({"error": "%s"})", e );
else
Log::Line( e );
exit(0);
}

if( json )
Log::Line("[");

for( int i = 0; i < deviceCount; i++ )
{
cudaDeviceProp cudaDevProps{};
CheckCudaSuccess( cudaGetDeviceProperties( &cudaDevProps, i ) );

if( json )
{
Log::Write( R"( {"id": %d, "name": "%s"})", i, cudaDevProps.name );
if( i+1 < deviceCount )
Log::Write( "," );

Log::NewLine();
}
else
Log::Line( "%-2d: %s", i, cudaDevProps.name );
}

if( json )
Log::Line("]");

exit(0);
}

#undef CheckCudaSuccess
CUDA_ERROR_EXIT:

if( json )
Log::Error( R"({ "error": "Failed to list CUDA devices with error 0x%llx: '%s'"})", (llu)err, cudaGetErrorString( err ) );
else
Log::Error( "Failed to list CUDA devices with error 0x%llx: '%s'.", (llu)err, cudaGetErrorString( err ) );

exit(1);
}


///
/// Plotting entry point
Expand Down
1 change: 1 addition & 0 deletions src/commands/CmdSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void CmdSimulateMain( GlobalPlotConfig& gCfg, CliParser& cli )
else if( cli.ReadSize( cfg.farmSize, "-s", "--size" ) ) continue;
else if( cli.ReadHexStrAsBytes( cfg.randomSeed, sizeof( cfg.randomSeed ), "--seed" ) ) continue;
else if( cli.ReadSwitch( cfg.noCuda, "--no-cuda" ) ) continue;
else if( cli.ReadI32( cfg.cudaDevice, "-d", "--device" ) ) continue;
else
break;
}
Expand Down
Loading